Re: [mapserver-users] Adding a wms layer

2009-04-14 Thread Pietro Giannini

Are you trying this:  http://mapserver.org/ogc/wms_client.html
by me it works well
bye
.pg

mark balman ha scritto:

Hi all

I amtrying to add a wms layer into my application but cannot seem to figure
this out. I would like to use the OnEarth layer from NASA. Can anyone point
me in the right direction?

Many thanks

Mark

  



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] display huge number of moving objects

2009-04-02 Thread Pietro Giannini
Hi Pradeep,
I'm not an OL expert, but you are right: adding a huge number of features
via javascript is not the right way, because OL is a javascript
environment and works locally on browser; managing too much features it
charge the local ram.

OpenLayer accept wms and mapserver layers
(http://www.openlayers.org/dev/examples/). Set up a server and add a OL
layer from it.

bye
pg



On Gio, Aprile 2, 2009 01:42, new2ms4w wrote:

 Hi All,
 I used Mapserver along with OpenLayers to generate moving objects and
 display them on roads in Minnesota map. I was using the OL to show the
 objects on the map and to move them to the next coordinate. (I update
 coordinates of point every 1 second.)

 We want to make this functionality scalable. Right now, if I add more than
 1000 objects the map display slows down and the web-browser starts
 consuming a lot of memory. ( I think this is because of the Javascript
 code)
 We want to generate up to 100,000 moving objects onto the map. Can you
 please suggest me how I go about this.

 I searched the forum archives and found this  useful. From what I can
 understand from it, I have to migrate to WMS to make this scalable.

 I have no clue as to what a WMS is. Before reading upon it, I just want to
 take your opinion if this is the right way to go.

 Thank you for your time.

 -Pradeep


 --
 View this message in context:
 http://n2.nabble.com/display-%22huge%22-number-of-moving-objects-tp2572268p2572268.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Projection object parameters for UTM to lat-long

2009-03-24 Thread Pietro Giannini

Bob,
maybe error is in first line: ellps-GRS80 is wrong, ellps=GRS80 is 
correct.

bye
pg

Bistrais, Bob ha scritto:


I am trying to project an object from UTM to lat-long.  I cannot get 
the projection to work, and I suspect it's the parameters for the UTM 
projection object.  I am trying to project from UTM Zone 19N, NAD 1983 
to lat-long.  Here is my code:


$projInObj = 
ms_newprojectionobj(proj=utm,ellps-GRS80,datum=NAD83,zone=19,units=m,north,no_defs); 


$projOutObj = ms_newprojectionobj(proj=latlong);
$poPoint = ms_newpointobj();
$poPoint-setXY($xmin, $ymin);
echo p/Coords:  . $poPoint-x . ,.$poPoint-y;
$poPoint = $poPoint-project($projInObj, $projOutObj);
echo p/x =  . $poPoint-x;
echo p/y =  . $poPoint-y;
$poPoint-free();

I can see the output using the echo lines.  The coordinates going into 
the point show up and are correct, but there are no x/y values after 
doing the project.  Can anyone see what I'm doing wrong?




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] gmap demo - map is not displaying

2009-03-24 Thread Pietro Giannini

Zizu,
I don't know the configration of FGS, but it seems a misconfiguration of 
the IMAGEPATH and/or IMAGEURL in the .map file.

Look in the WEB section of .map file.
http://mapserver.org/mapfile/web.html?highlight=IMAGEPATH%20IMAGEURL
bye
.pg


zizu ha scritto:

hello users...
brbrI am a newbie nbsp;to mapserver. i am trying to get the gamp demo to 
run in my
brmachine fedora 9. i have installed FGS- mapserver 5.2.1 a Stand alone 
environment.
brI have done all the steps given in the Gmap demo Installation file.
bri have added the AddTypes in the httpd.cong. Perhaps i have made the edits
brin the php.ini file. now when i call nbsp;the
brbra href=http://localhost/gmap/gmap75.phtml; target=_top 
rel=nofollowhttp://localhost/gmap/gmap75.phtml/abrbri stunned to see everything is projecting except the 
map is not rendering.
brat the beginning i thought it might be a problem of the java mode is enabled
brthen i tried to disabled that but i failed it was also not working 
nbsp;Then i looked into the httpd error log file ...
bri got this following error
brbr[Tue Mar 24 05:13:02 2009] [error] [client 127.0.0.1] File does not exist: /home/kapil/FGS-MAPSERVER/tmp/ms_tmp/49c81e86_ba0_.gif, referer: a href=http://localhost:8080/gmap-ms46/htdocs/gmap75.phtml?drainage=Ydrain_fn=Ybathymetry=Ypopplace=Yprov_bound=Yfedlimit=Yland_fn=YViewRegion=Quick+Viewminx=-2601225.031773miny=-712631.00maxx=3474025.031773maxy=384.00imagewidth=400imageheight=300CMD=INPUT_TYPE=INPUT_COORD=KEYMAPXSIZE=100KEYMAPYSIZE=75MapSize=400%2C300JavaOff.x=14JavaOff.y=21PREVIOUS_MODE=0; target=_top 
rel=nofollowhttp://localhost:8080/gmap-ms46/htdocs/gmap75.phtml?drainage=Ydrain_fn=Ybathymetry=Ypopplace=Yprov_bound=Yfedlimit=Yland_fn=YViewRegion=Quick+Viewminx=-2601225.031773miny=-712631.00maxx=3474025.031773maxy=384.00imagewidth=400imageheight=300CMD=INPUT_TYPE=INPUT_COORD=KEYMAPXSIZE=100KEYMAPYSIZE=75MapSize=400%2C300JavaOff.x=14JavaOff.y=21PREVIOUS_MODE=0/abr[Tue Mar 24 05:13:02 2009] [error] [client 127.0.0.1] File does not exist: /home/kapil/FGS-MAPSERVER/tmp/ms_tmp/49c81e86_ba0_0.gif, referer: a 
href=http://localhost:8080/gmap-ms46/htdocs/gmap75.phtml?drainage=Ydrain_fn=Ybathymetry=Ypopplace=Yprov_bound=Yfedlimit=Yland_fn=YViewRegion=Quick+Viewminx=-2601225.031773miny=-712631.00maxx=3474025.031773maxy=384.00imagewidth=400imageheight=300CMD=INPUT_TYPE=INPUT_COORD=KEYMAPXSIZE=100KEYMAPYSIZE=75MapSize=400%2C300JavaOff.x=14JavaOff.y=21PREVIOUS_MODE=0; target=_top 
rel=nofollowhttp://localhost:8080/gmap-ms46/htdocs/gmap75.phtml?drainage=Ydrain_fn=Ybathymetry=Ypopplace=Yprov_bound=Yfedlimit=Yland_fn=YViewRegion=Quick+Viewminx=-2601225.031773miny=-712631.00maxx=3474025.031773maxy=384.00imagewidth=400imageheight=300CMD=INPUT_TYPE=INPUT_COORD=KEYMAPXSIZE=100KEYMAPYSIZE=75MapSize=400%2C300JavaOff.x=14JavaOff.y=21PREVIOUS_MODE=0/abr[Tue Mar 24 05:13:02 2009] [error] [client 127.0.0.1] File does not exist: /home/kapil/FGS-MAPSERVER/tmp/ms_tmp/49c81e86_ba0_1.png, referer: a 
href=http://localhost:8080/gmap-ms46/htdocs/gmap75.phtml?drainage=Ydrain_fn=Ybathymetry=Ypopplace=Yprov_bound=Yfedlimit=Yland_fn=YViewRegion=Quick+Viewminx=-2601225.031773miny=-712631.00maxx=3474025.031773maxy=384.00imagewidth=400imageheight=300CMD=INPUT_TYPE=INPUT_COORD=KEYMAPXSIZE=100KEYMAPYSIZE=75MapSize=400%2C300JavaOff.x=14JavaOff.y=21PREVIOUS_MODE=0; target=_top 
rel=nofollowhttp://localhost:8080/gmap-ms46/htdocs/gmap75.phtml?drainage=Ydrain_fn=Ybathymetry=Ypopplace=Yprov_bound=Yfedlimit=Yland_fn=YViewRegion=Quick+Viewminx=-2601225.031773miny=-712631.00maxx=3474025.031773maxy=384.00imagewidth=400imageheight=300CMD=INPUT_TYPE=INPUT_COORD=KEYMAPXSIZE=100KEYMAPYSIZE=75MapSize=400%2C300JavaOff.x=14JavaOff.y=21PREVIOUS_MODE=0/abrbrbrHerewith i am attaching the screen shot of the page for your view
brnbsp;
bri am struggling to solve this problem for the past two days.. 
nbsp;someone
brplease help me out.
brbrany help/tips will be appreciated
brbrThanks,
brzizu nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; 
brbra href=http://n2.nabble.com/file/n2524064/Screenshot-1.png; target=_topScreenshot-1.png/a
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Problems with Google 900913 Projection and WMS Layers

2009-03-18 Thread Pietro Giannini

Put the epsg definition directly on .map file:

MAP
...
   PROJECTION
   +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs

   END
...
END

bye
...pg

Bill Thoen ha scritto:
I'm trying to get my WMS server to produce WMS layers for an 
OpenLayers application I'm building that uses some Google map layers. 
But I'm getting no results. DEBUG set to ON in my mapfile produces the 
following errors (this is the last three lines of the log file:
[Tue Mar 17 15:16:28 2009].567265 msProcessProjection(): Projection 
library error. no options found in 'init' file
[Tue Mar 17 15:16:28 2009].578247 msProcessProjection(): Projection 
library error. no options found in 'init' file
[Tue Mar 17 15:16:28 2009].603064 msProcessProjection(): Projection 
library error. no options found in 'init' file


I did put the definition for the Google CRS in /usr/share/proj/defs as:

# Google's spherical mercator projection
900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs 


So could someone here clue me in to what's wrong? What's the 'init' 
file and what do I need to put in it? I'm on a Linux system with 
mapserver set up like so:
MapServer version 5.0.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE 
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=GEOS INPUT=EPPL7 
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE


Below is my mapfile if you want to see it.
TIA,
- Bill Thoen

---
MAP
  CONFIG MS_ERRORFILE /var/www/html/tmp/ms_errors.txt
  DEBUG ON
#  EXTENT -102.39 36.81 -94.44 40.13
  EXTENT -20037508.34  -20037508.34  20037508.34  20037508.34
  IMAGECOLOR 255 255 255
  SHAPEPATH /var/www/vfm/
  FONTSET /var/www/maps/fonts/fonts.txt
  SYMBOLSET /var/www/maps/symbols/symbols.txt

  OUTPUTFORMAT
 NAME 'AGG'
 DRIVER AGG/PNG
 MIMETYPE image/png
 IMAGEMODE RGB
 EXTENSION png
  END

  WEB
 IMAGEPATH /var/www/html/tmp/
 IMAGEURL /tmp/
 METADATA
wms_title VFM Data Layers
wms_onlineresource 
http://xxx.xxx.xxx.xxx/cgi-bin/mapserv?map=/var/www/html/vfm/ms.map;

wms_srs EPSG:4326 EPSG:900913
 END
  END

  PROJECTION
 init=epsg:900913
  END
  UNITS METERS

  LAYER
 NAME states
 METADATA
wms_title US State boundaries
wms_srs EPSG:32614 EPSG:4326 EPSG:900913
 END
 TYPE POLYGON
 STATUS ON
 DATA ../maps/data/states
 CLASS
NAME US States
STYLE
   OUTLINECOLOR 0 0 0
   WIDTH 2
END
 END
 PROJECTION
init=epsg:32614
 END
  END

  LAYER
 NAME counties
 METADATA
wms_title County Boundaries
wms_srs EPSG:4269 EPSG:4326 EPSG:900913
 END
 TYPE POLYGON
 STATUS ON
 DATA ../maps/data/County_tiger_2007_region
 CLASS
NAME County Boundaries
STYLE
   OUTLINECOLOR 128 128 128
   COLOR 255 255 192
   WIDTH 1
END
 END
 PROJECTION
init=epsg:4269
 END
  END
END


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Drawing a simple filled polygon with PHP/mapscript

2009-03-11 Thread Pietro Giannini

Hi indieaz,

add:
$layer-set(type,MS_LAYER_POLYGON);
$layer-set(status,MS_DEFAULT);  




indieaz ha scritto:

Been doing a lot of tinkering, have been plotting points on maps with variety
of shapes from database sources etc.  However, I'm now against what I
believe should be an extremely simple problem.

I have a set of coordinates (max lat/long and min lat/long) that make up a
rectangle I need to plot onto my map.  I'm pulling my hair out...I get a
.png image out, but it's empty.  Here's an example of the code I'm trying to
use:

$map = ms_newMapObj();
$layer = ms_newLayerObj($map);
$polygon= ms_newShapeObj(MS_SHAPE_POLYGON);
$polyLine = ms_newLineObj();
$polyLine-addXY(60,60);
$polyLine-addXY(75,60);
$polyLine-addXY(75,75);
$polyLine-addXY(60,75);
$polyLine-addXY(60,60);
$polygon-add($polyLine);

$Class = ms_newClassObj($layer);
$Class-set( name,MyClass);
// Create a style object defining how to draw features
$lineStyle = ms_newStyleObj($Class);
$lineStyle-color-setRGB(255,255,0);


and my .map file:

MAP

  STATUS ON
  SIZE 600 400
  IMAGECOLOR 255 255 255
  IMAGETYPE PNG
  extent -180 -90 180 90
  PROJECTION
init=epsg:4326
  END

END
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] [Expresion] Problem with expresion

2009-03-10 Thread Pietro Giannini

Hi David,
the EXPRESSION should be :
   EXPRESSION ([LEGENDE] = NetCenter OR [LEGENDE] = POP 
LDCom)


ciao ...pg



David Martinez Morata ha scritto:

Hello

I define in my map file one layer like:

LAYER
NAME POP Neuf Telecom
TYPE POINT
DATA ldnc_w84_05keu_sites_heberge.shp
METADATA
wms_title POP Neuf Telecom
wms_srsEPSG:4326
wms_feature_info_mime_typetext/html
wms_include_itemsall
END
STATUS ON
MAXSCALE 100
#TRANSPARENCY 100
PROJECTION
init=epsg:4326
END
CLASSITEM LEGENDE
CLASS
NAME POP Neuf Telecom
EXPRESSION (NetCenter OR POP LDCom)
   
STYLE

SYMBOL CIRCLE
SIZE 10
OUTLINECOLOR 255 255 255
COLOR 0 197 255
END
END
END

But I don't find my Points!
I have a string  value in my CLASSITEM LEGENDE

And the values I try to see are:

NetCCenter and POP LDCom
Can anyone help me?
--
Martinez Morata David
Thinking GIS


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] PHP mapscript - browser showing blank page

2009-03-03 Thread Pietro Giannini

Kapilmanoj, check the extent of your data sources.
Maybe you set wrong extent in map file, so the layers are visible but no 
data overlays the defined window.

bye
...pg

kapilmanoj ha scritto:

Hi pietro,

 As you suggested me, i checked the error_log file , there is no such error
related to php. Actually in my case, its projecting the imagecolor 256 255
255 , the faded green color with the respective width and height in the
browser,  but it not showing up the map layers . its stumbling.

what could be a problem?
can you probe this problem?

thanks.
kapilmanoj 


Pietro Giannini wrote:
  

Hi Kapilmanoj,

1) maybe it is an error on
IMAGECOLOR 256 255 255
the first integer must be = 255.
if not:

2) try to intercept mapserver errors calling the map image in cgi mode:

http://localhost/cgi-bin/mapserv?map=/path/to/kerala.mapmode=maplayer=keralalayer=modis_jpllayer=...

if it works,

3) see the php_errors log file (set in php.ini, error_log directive).

bye
.pg

kmanoj-pg7 kmanoj-pg7 ha scritto:


Dear users,

I am using  mapserver 5.0.3 , php 5.2.5 version on fedora 9. I am 
trying to work out the examples given in the mapserver site, but i am 
getting the blank page when i call the link through browser


http://localhost/mapfiles/sampletest/htdocs/kerala.php


 Mapscript is working fine without making any problem, but when i 
trying to import mapfile in PHP and cascade it through the mapserver, 
it rendering blank page in the browser.

i think it could be a problem of extent.

Herewith i am attaching my mapfile and php file for your kind perusal

can anyone please puzzled out this problem.

suggestion will be appreciated.

Thanks,
kapilmanoj



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
  
  

--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users





  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] PHP mapscript - browser showing blank page

2009-03-02 Thread Pietro Giannini

Hi Kapilmanoj,

1) maybe it is an error on
   IMAGECOLOR 256 255 255
   the first integer must be = 255.
   if not:

2) try to intercept mapserver errors calling the map image in cgi mode:
   
http://localhost/cgi-bin/mapserv?map=/path/to/kerala.mapmode=maplayer=keralalayer=modis_jpllayer=...

   if it works,

3) see the php_errors log file (set in php.ini, error_log directive).

bye
.pg

kmanoj-pg7 kmanoj-pg7 ha scritto:

Dear users,

I am using  mapserver 5.0.3 , php 5.2.5 version on fedora 9. I am 
trying to work out the examples given in the mapserver site, but i am 
getting the blank page when i call the link through browser


http://localhost/mapfiles/sampletest/htdocs/kerala.php


 Mapscript is working fine without making any problem, but when i 
trying to import mapfile in PHP and cascade it through the mapserver, 
it rendering blank page in the browser.

i think it could be a problem of extent.

Herewith i am attaching my mapfile and php file for your kind perusal

can anyone please puzzled out this problem.

suggestion will be appreciated.

Thanks,
kapilmanoj



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] file output

2009-02-27 Thread Pietro Giannini

shp2img, a tool in FWTools (http://fwtools.maptools.org/)

.pg

Stanislav Bek ha scritto:
Hi, 


how can I directly save image file from Mapserver?

Wenn I put  
http://localhost/cgi-bin/mapserv?map=/var/mapservdata/jezera.mapmode=map
into browser, I get html with image. I tried to use wget in shell in order to save the image 
file directly to disc. Without success. 


Could you please give me an advice.
Stanislav 






___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] WMS problem

2009-02-27 Thread Pietro Giannini

Hi Andrea,
did you look on the php error log file?
pg

Andrea Ardito ha scritto:

Hi Pietro,

1.I've tried to invoke mapserver in cgi mode and it seems ok.
http://webgis.provincia.biella.it/cgi-bin/mapserv?map=/opt/fgs/apps/mapservergeo/map/basewms.mapmode=maplayer=stati 

 
2. We looked on the apache log file and we fixed some errors we had in 
a php file.

Anyway things are not changed.
http://webgis.provincia.biella.it/apps/maplab/projects/gmf_apps/basewms4/wmdmap.php 

 
Please, do you have anything else to suggest?

Thank you very much for your help
ciao
andrea
 
arch. Andrea ARDITO

Sistema Informativo Territoriale Ambientale (S.I.T.A.)
Settore Pianificazione e Sicurezza del Territorio
Provincia di Biella
Via Quintino Sella, 12 - 13900 BIELLA
tel. 015.8480880
fax. 015.8480740


-Original Message-
From: Pietro Giannini pgiann...@bytewise.it
To: mapserver-users mapserver-users@lists.osgeo.org
Date: Thu, 26 Feb 2009 16:11:41 +0100
Subject: Re: [mapserver-users] WMS problem

Hi Andrea,

1. no
2. no matters
3. It is difficult to answer...

If the problem is EXTENT  PROJECTION, remember that a .map file
has the PROJECTION set at map level and PROJECTIONs set at layers
level; the map Projection is the projection system of the result
of the map (i.e. the map image), the layer Projection is the
projection system of the data source of the layer. If a layer
datasource projection differs from the map projection, you must to
set it, otherwise ms try to project the data according with map
projection.
Try invoke mapserver in cgi mode to see the results:
http://the.host/cgi-bin/mapserv?map=/path/of/the.mapmode=maplayer=
...

Imho your problem isn't the map, but occurs in your php script.
Take a look on the php error log: it is a text file, its path is
set in your php.ini file (error_log directive, can be an absolute
or relative path)

4. obviously scale is nonsense when using non-projected reference
systems like epsg:4326, but mapserver does not know.

hth

ciao
pg



-- Pietro Giannini Bytewise srl - Area GIS 41°50'38.58N 
12°29'13.39E






Andrea Ardito ha scritto:
Hi, we have this system working with MapServer version 4.8.2, PHP version 
4.4.2. I am trying to do a map that shows both layer (WGS84 shapefile) and 
WMS data togheter. The starting response is ok, but I get the blank image 
from the first pan or zoom on. This is the example URL: 
http://webgis.provincia.biella.it/apps/maplab/projects/gmf_apps/basewms4/wmdmap.php
  I guess the problem is due to wrong parameters for EXTENT, SIZE and 
PROJECTION in the mapfile. These are: EXTENT -15 25 40 70 SIZE 470 520 
PROJECTION init=epsg:4326.  The question are: 1. the SIZE (in pixel) has 
to be proportional to the EXTENT? 2. if yes, how to obtain the right values 
for the EXTENT? 3. if not, where is the problem? 4. in a map with geographic 
non-projected data like this, is correct to have value for scale of the 
representation since UNITS are DD?  I would be very grateful for any help 
from you all, thanks! Best regards andrea ardito  P.S. If I set no layer in 
the map file, and I try to represent only WMS layer (adding them from 
Servizi WMS button), it works.


 
arch. Andrea ARDITO

Sistema Informativo Territoriale Ambientale (S.I.T.A.)
Settore Pianificazione e Sicurezza del Territorio
Provincia di Biella
Via Quintino Sella, 12 - 13900 BIELLA
tel. 015.8480880
fax. 015.8480740


--http://www.provincia.biella.it--


Vuoi rimanere sempre aggiornato sulle nostre attivita'?
Visita la pagina dei feed RSS sul nostro sito ed iscriviti alla
sezione di interesse.


--Avviso--

Questo messaggio e i suoi allegati sono riservati esclusivamente
alle persone in
indirizzo e possono contenere informazioni confidenziali. Se
questo messaggio vi e'
pervenuto per errore, vi informiamo che ogni suo uso e'proibito.
In questo caso rispedite immediatamente il messaggio al mittente
e cancellatelo.
Per ogni chiarimento contattateci scrivendo a
c...@provincia.biella.it.
Grazie -Il Webmaster.

--Warning-

This message and its attachments are addressed solely to the
persons above and may
contain confidential information. If you have received the
message in error, be
informed that any use of the content hereof is prohibited.
Please return it immediately to the sender and delete the
message. Should you have
any questions, please contact us by replying to
c...@provincia.biella.it.
The Webmaster

Re: [mapserver-users] hide .map contents

2009-02-12 Thread Pietro Giannini

Hi Greg.

1) No. You can only
   - use the FILTER at layer level, or
   - have multiple .ovf files and pass their name (eg CONNECTION 
%filename%), or
   - use mapscript to flush the query in the .ovf file (this means to 
rethink the whole application...).

2) Please post the map file.

ciao  pg

Greg Luker ha scritto:

Hi mapservers-users,

Thanks Steve W, Pietro, and Andreas for your help!

I have got around some of the problem (MapServer error messages and 
MySQL passwords visible in browser View/Source) by moving the OGRVRT 
MySQL info from inline in the .map file into an external .ovf file 
(Pietro's 1024 characters problem seems right), but two problems remain.


1) I originally abandoned external .ovf file because I can't pass 
variables into it like I can when inline (eg can't do 
(s.site_num_previous_surveys = %myvarn%) in external .ovf). Is there 
a way to use variables in .ovf file?


2) I am still getting an error in View/Source:
br!--getString(): Symbol definition error. Parsing error near 
(DD):(line 677)--
I've tried finding this problem in SYMBOL-related commands in the .map 
file, but no luck. Any ideas?


(I can send .map file if that helps)

Thanks,
Greg Luker.
Australia.




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Problems with MapScript and setProjection

2009-02-10 Thread Pietro Giannini
Tim,
maybe you set a map extent wich don't coincides with the extent of the
dataset.

If you change the projection of the map you should change the extent
according with the new projection.

Try reproject the extent of the map:

$oMapProjection = ms_newProjectionObj($map-getProjection());
$oNewProjection = ms_newProjectionObj(+proj=tcc +lon_0=90w +ellps=GRS80);
$oRect = $map-extent;
$oRect-project($oMapProjection,$oNewProjection);
$map-setExtent($oRect-minx,$oRect-miny,$oRect-maxx,$oRect-maxy);
$map-setProjection(+proj=tcc +lon_0=90w +ellps=GRS80);

let me know, ciao
...pg

STOP !! ERRATA CORRIGE:
Now I read the new php MapScript documentation and found a new
implementation of the setprojection() function:

   int setProjection(string proj_params, boolean bSetUnitsAndExtents)

bSetUnitsAndExtents (default false), if true force the map to update
Extents and Units based on the new projection (I suppose it works with the
last release, 5.2.1)

bye ...pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


On Lun, Febbraio 9, 2009 19:19, Tim Wood wrote:
 Tom, that PPT linked from your example is filled with good stuff.
 Anyway, I took your example and did some minor changes to make it work
 with mapscript as Fedora installs it and my data. Then I added the
 ability to turn projection on  off. With the projection off, everything
 works great. But, I'm still getting a blank image with the projection
 turned on. If anyone has any pointers on what's wrong with the code
 (below) I'd appreciate it.

 Tim Wood

 -
 ?PHP

 // Where my key directories are located
 $doc_root = '/var/www/html';
 $rel_path = example1/round2;
 $base_path = $doc_root/$rel_path;

 // An empty map file
 $base_map = $base_path/data/empty.map;

 // The data I'm using (Statistics Canada's 2006 FSA files)
 $shape_path = $base_path/data/zcta/zt08_d00_shp/; // goofy path
 I'm too lazy to fix
 $shape_file = gfsa000b06a_e;  // works with or
 w/o the extension
 $shape_file_projection = +proj=longlat +datum=NAD83;

 // The Extents (area) I want in latitude, longitude (Canada)
 list( $ex0, $ex1, $ex2, $ex3 ) = array(-140, 40, -50, 55 );

 // Describe the rest of my output
 $output_projection = '';
 $output_projection = +proj=tcc +lon_0=90w +ellps=GRS80;
 $output_file_rel = output/index2.png;
 $output_file_path = $base_path/$output_file_rel;
 list($output_width, $output_height ) = array( 600, 500 );



 // Load MapScript extension
 if (!extension_loaded(MapScript))
 dl('php_mapscript.'.PHP_SHLIB_SUFFIX);

 // add map
 $map = ms_newMapObj( $base_map );

 // tdw temp
 $map-setExtent( $ex0, $ex1, $ex2, $ex3 );

 // Set the shapepath
 $map-set( 'shapepath', $shape_path );
 // Set the output format and size
 $map-selectOutputFormat( 'png' );
 $map-setSize( $output_width, $output_height );

 // add new layer to map
 $layer = ms_newLayerObj($map);
 $layer-set(name, foo);
 $layer-set(status, MS_ON);
 $layer-set(data, $shape_file );
 $layer-set(type, MS_SHAPE_POLYGON );
 $layer-setProjection( $shape_file_projection );

 // This line hides a bunch of errors that appear iff $output_projection
 is set
 $layer-set(template, ttt);
 $layer-set(dump, true);

 // add new class to new layer
 $class = ms_newClassObj($layer);
 $class-set(name, foo);

 // add new style to new class
 $style = ms_newStyleObj($class);
 $style-color-setRGB(255, 0, 0);
 $style-outlinecolor-setRGB( 128,128,128 );

 if( $output_projection != '' ) {   // Project and Draw
 // create new rect to query against the new layer
 $rect = ms_newRectObj();
 $rect-setExtent( $ex0, $ex1, $ex2, $ex3 );

 // query new layer
 $layer-queryByRect( $rect );
 $map-queryByRect( $rect );

 // set projection of output map
 $map-setProjection($output_projection, MS_TRUE);

 // draw
 $image = $map-drawQuery();
 } else {  // Just draw the map
 // draw
 $image = $map-draw();
 }

 // Save the image
 $image-saveImage( $output_file_path );

 ?
 html
 body
 img src=?PHP print $output_file_rel; ?
 /body
 /html
 -


 Kralidis,Tom [Ontario] wrote:
 I've added a small example at:

 http://trac.osgeo.org/mapserver/wiki/PHPMapscriptAddLayerQueryReproject

 Hope this helps.

 ..Tom



 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org on behalf of Tim Wood
 Sent: Sat 07-Feb-09 22:55
 To: mapserver-users@lists.osgeo.org
 Subject: [mapserver-users] Problems with MapScript and setProjection

 I've been round and round with setProjection in MapScript and
 setProjection today. I either get the infamous blank image  or the image
 returns in the same proportions as the original lat/long data. Proj
 seems to be (at least partially) working because if I forget something
 like +ellps=[blah blah], it throws an error

Re: [mapserver-users] c# or php?

2009-02-06 Thread Pietro Giannini
Hi Michele,
I'm currently working on a C# MapScript application on a SharePoint
environment.

I cannot answer your 1st question, but if you already developed a test app
you shouldn't have problems...
I currently use the csharp_mapscript that came with the last ms4w, no
matter to recompile it.

Maybe the idea of use both apache-php and iis-.net is possible, but it
seems me an unnecessary complication.

I found usefully this article - for PostGIS connection too:
http://www.paolocorti.net/2006/09/20/mapserver-tutorial-for-c-mapscript-asp-net/

ciao  pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Ven, Febbraio 6, 2009 17:13, Shimomura,  Michele L.- 
Environmental
Health wrote:
 Hi all,



 I'm pretty new to MapServer and I've created some proof of concept apps,
 but I'm at a decision point for how to move forward and would like to
 hear others' opinions.



 First, the small applications that I created were in Visual Studio 2008
 using the c# mapscript that came with the MS4W package, but now I've
 found out that our Windows 2003 server is running IIS 6 in 64-bit mode.



 So, my question is:

 1) Can I compile everything to work in Windows and 64 bit and are there
 instructions on how to do that somewhere? In googling, I read something
 about buildbot, but that site seems to be down.



 2) Or, would I be better off just using Apache and the PHP
 mapscript?



 I'll be integrating these maps into a SharePoint Intranet environment
 (built in c#), so that's why my preference is towards that way.  And if
 I go with #2, I'm thinking I can still use my c# front end but then
 create php web services to return functionality.  Also, eventually, the
 functionality will need to be able to insert/update PostGreSQL spatial
 data.



 I would love to hear from others who have done this before because, if
 possible, I'd like to avoid getting way down path only to have many
 unexpected surprises.



 Thanks in advance for your help!

 Michele

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Create a button for Query

2009-01-29 Thread Pietro Giannini
There is not another way than use javascript.

The mapserver cgi receive the mode (can be map, browse,
query,nquery...) parameter from the template because the template
contains - in the form which do a submit() - a control named mode.

The drop-down list sure is named mode, so there can be not another
control - e.g. a hidden field - named mode.

The only way is making a button like:
input typebutton value=query the map
onclick=javascript:document.forms['mapserv'].mode.value='query'; /
A click on button change the drop-down value in browse, and a click on
the map will submit the url with a parameter like ... browse=query...

... At this point you can also prefer to change the drop-down with a
series of buttons, one for each mode you want, each button changing the
value of an hidden field named mode...

ciao  ...pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Gio, Gennaio 29, 2009 04:25, boesiii wrote:

 My current html template has a drop down list for map modes, browse,
 single
 layer query and multi-layer query.  I would like to have a single button
 for
 querying.  Will I have to use javascript or is there a simpler way?
 --
 View this message in context:
 http://n2.nabble.com/Create-a-button-for-Query-tp2236684p2236684.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] create attributes for dynamic polygon layer

2009-01-28 Thread Pietro Giannini
I was engaged in a similar question.
It is not possible, you must to try a different method.
Read this thread:
http://lists.osgeo.org/pipermail/mapserver-users/2009-January/059537.html

ciao  .pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Mar, Gennaio 27, 2009 16:37, Mathias Tobler wrote:
 html
 body
 font size=3I sent this (probably wrongly) to the mapserver-dev list a
 couple about a week ago and have not heard back from anyone. So I am
 trying my luck here.brbr
 I am using PHP MapScript to create a polygon layer based on data stored
 in a MySQL database. The layer will show 1x1 degree grid cells and each
 cell should be colored according to the number of point records it
 contains. The summary is don in SQL and the query returns the coordinates
 of the lower left corner of each cell as well as a column 'Count' with
 the number of recrods in each cell. The geometry part work fine but I
 would like to add an attribute so I can assign different collors to the
 polygons. While $oNewShape-gt;set(quot;textquot;,$label); works great
 for labeling polygons I wonder if there was a similar methods that will
 work with the EXPRESSION statement so that I can define different classes
 for the layer. Using MySQL is given by our application and I won't be
 able to switch to PostGIS. Any suggestions are wellcome. brbr
 Mathiasbrbr
 br
 # Create a layer to hold density polygonsbr
 $oLayerPoly = ms_newLayerObj($oMap);br
 $oLayerPoly-gt;set( quot;namequot;, quot;ColDensityquot;);br
 $oLayerPoly-gt;set( quot;typequot;, MS_LAYER_POLYGON);br
 $oLayerPoly-gt;set( quot;statusquot;, MS_DEFAULT);brbr
 foreach($summary_rows as $row)br
 {br
 $oNewLine = ms_newLineObj();br
 $oNewLine-gt;addXY($row['minLong'],$row['minLat']);br
 $oNewLine-gt;addXY($row['minLong']+1,$row['minLat']);br
 $oNewLine-gt;addXY($row['minLong']+1,$row['minLat']+1);br
 $oNewLine-gt;addXY($row['minLong'],$row['minLat']+1);br
 $oNewLine-gt;addXY($row['minLong'],$row['minLat']);br
 x-tabnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabnbsp;nbsp;
 br
 $oNewShape = ms_newShapeObj(MS_SHAPE_POLYGON);br
 $oNewShape-gt;add($oNewLine);br
 x-tabnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabbr
 $label = $row['Count'];br
 x-tabnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabbr
 $oNewShape-gt;set(quot;textquot;,$label);br
 x-tabnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabbr
 $oLayerPoly-gt;AddFeature($oNewShape);br
 x-tabnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabx-tab
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/x-tabbr
 } /font/body
 /html

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Is there a way to add a single click zoom button

2009-01-23 Thread Pietro Giannini
found!

1. the hidden field for zoom value should have the name zoom and not
zoomsize, is a cgi variable.

2. the submit control Refresh Map should have no name:
  input type=submit value=Refresh Map
because the script attempts to run the form.submit() function, but the
browser intercept the name of this control and return an error submit
is not a function.

3. the button control Print Map should have no name: see above.

in my machine it works, let me know.
bye
pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Ven, Gennaio 23, 2009 14:30, boesiii wrote:

 PG, here is the template file and map file.

 http://n2.nabble.com/file/n2203271/awa_map_final.html awa_map_final.html
 http://n2.nabble.com/file/n2203271/awa_map.map awa_map.map
 --
 View this message in context:
 http://n2.nabble.com/Is-there-a-way-to-add-a-single-click-zoom-button-tp2158109p2203271.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] c# mapscript: a strange behavior with ovf inline connection

2009-01-23 Thread Pietro Giannini
Hi list.

I found a strange error in c# mapscript on drawing a map image when a
layer has a virtual spatial data connection.

The error is:
System.ApplicationException was unhandled by user code
  Message=msBuildPath(): Unable to access file.
(C:\\svil\\EMS\\map\\OGRVRTDataSource\nOGRVRTLayer
name='object'\nSrcDataSourceODBC:sa/password...@ems_object/SrcDataSource\nSrcLayerobject/SrcLayer\nFIDId/FID\nSrcSQL\nSELECT
Dim_Unit.Id, Dim_Unit.Description, Dim_Unit.Icon AS Icon, [...] FROM
Dim_Unit WHERE Dim_Unit.Id [...]
/SrcSQL\nGeometryTypewkbPoint/GeometryType\nGeometryField
encoding='PointFromColumns' x='LON'
y='LAT'/\n/OGRVRTLayer\n/OGRVRTDataSource: path is too long
  Source=mapscript_csharp

([...] = omissis due to lenght of the query)

the error occurs only:
- in mapscript_csharp, I tried with php_mapscript and it does not occur;
- if the ovf connection string is INLINE at layer level, when I use the
classic .ovf file it does not occur;
- if the ovf connection string is longer than 1022 characters (!)

other infos, if useful:
- ODBC connection to a MS SQLserver 2005;
- development in ASP.NET (VS2005), the deploy environment is a Share Point
portal, the application is embedded in a WebPart.

Any idea?
many thanks
bye ..pg



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] dynamically added shapes and their values

2009-01-22 Thread Pietro Giannini
Dan,
I considered this solution, as well as (Steve) creating a layer for each
classification.

maybe you are right, despite I must to generate a different file for each
user-session: other garbage in tmp dir... :)

possibility of apply a style to a single feature can be a great
functionality for further releases...

what about the STYLEITEM?
http://mapserver.org/mapfile/layer.html?highlight=styleitem
http://mapserver.org/mapscript/mapscript.html?highlight=styleitem
---

thanks all
bye ..pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


On Mer, Gennaio 21, 2009 22:09, Dan Little wrote:
 Totally spit balling...

 What about writing your layer to a temp. file that's KML/GML.

 The file size is small, it carries the attributes you want, and it's easy
 to  write the file using anything that writes text files (presumable C#
 can write text files ... but I know Microsoft misses little details from
 time to time).

 Then write yourself a little mapfile you can open... maybe following this
 as a guide...
 http://mapserver.org/input/vector/gml.html
 -or-
 http://mapserver.org/input/vector/kml.html

 And just change CONNECTION using Mapscript to whatever the location of
 your newly created KML/GML file happens to be, then proceed with the
 processing.



 - Original Message 
 From: Steve Lime steve.l...@dnr.state.mn.us
 To: Pietro Giannini pgiann...@bytewise.it;
 mapserver-users@lists.osgeo.org
 Sent: Wednesday, January 21, 2009 2:43:31 PM
 Subject: Re: [mapserver-users] dynamically added shapes and their values

 PG: At this point inline feature can carry no attributes and as a result
 cannot
 be
 classified. So I don't think you're going to be able to make this work.
 The work
 around is to use separate layers for what would have been a class and
 add
 features to the appropriate layer.

 Steve

  On 1/21/2009 at 10:29 AM, in message
 55312.89.97.235.106.1232555376.squir...@localhost.localdomain, Pietro
 Giannini wrote:
  Hi all,
 
  I'm working to a c# asp.net project embedding a mapscript application.
 
  My attempt is to add dynamically features to a layer object and
 classify
  them in different colors.
  The features are INLINE features: I don't add the features to the
 source
  of the layer.
 
  I'm able to create different classes and styles in the layer, set a
 field
  as classitem and set an EXPRESSION string to the class.
 
  I found the
  shapeObj.initValues(numOfFields)
  method, which cannot set the field names, only the number, and also
 the
  shapeObj.setValue(indexOfField, valueAsString)
  for setting the value.
 
  Now I need a field name to set a CLASSITEM property of the layer!!!
  I found no methods to add a named field to the layer.
 
  Maybe I follow a wrong way...
 
  Someone has an idea?
  thanks in advance
  ...pg
 
 

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users







___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Is there a way to add a single click zoom button

2009-01-22 Thread Pietro Giannini
boesiii,
there is no reason why both buttons cannot work together.

can you pls post the entire template?

bye
..pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


On Mer, Gennaio 21, 2009 19:47, boesiii wrote:

 PG,

 The button is not working because of I have a refresh button with a
 submit
 value I think.  The refresh button is for updating layers.  How can I make
 is so both buttons work.

 Code:
 input type=submit name=submit value=Refresh Mapbr
 --
 View this message in context:
 http://n2.nabble.com/Is-there-a-way-to-add-a-single-click-zoom-button-tp2158109p2193900.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] dynamically added shapes and their values

2009-01-21 Thread Pietro Giannini
Hi all,

I'm working to a c# asp.net project embedding a mapscript application.

My attempt is to add dynamically features to a layer object and classify
them in different colors.
The features are INLINE features: I don't add the features to the source
of the layer.

I'm able to create different classes and styles in the layer, set a field
as classitem and set an EXPRESSION string to the class.

I found the
shapeObj.initValues(numOfFields)
method, which cannot set the field names, only the number, and also the
shapeObj.setValue(indexOfField, valueAsString)
for setting the value.

Now I need a field name to set a CLASSITEM property of the layer!!!
I found no methods to add a named field to the layer.

Maybe I follow a wrong way...

Someone has an idea?
thanks in advance
...pg



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Is there a way to add a single click zoom button

2009-01-20 Thread Pietro Giannini
Your code seems correct...

maybe a javascript error.
If you use firefox you can intercept javascript errors with the error
console.

my code, simplified, is:

html
head
script language=JavaScript
function zoom2x()
{
document.forms['mapserv'].imgxy.value =
[mapwidth]/2 +   + [mapheight]/2;
document.forms['mapserv'].zoom.value = 2;
document.forms['mapserv'].submit();
}
/script
/head
body
form name=mapserv method=GET action=/cgi-bin/mapserv.exe
!-- the map path, mandatory --
input type=hidden name=map value=[map]
!--  the center of the img, no matter to valorize with the [center] cgi
variable  --
input type=hidden name=imgxy
!-- the current extent of the map, mandatory --
input type=hidden name=imgext value=[mapext]
!-- the zoom --
input type=hidden name=zoom
!-- the map image --
input type=image name=img src=[img] width=[mapwidth]
height=[mapheight] alt=map
!-- the button --
input type=button value=zoom in 2 X onclick=javascript:zoom2x();
/form
/body
/html

this work, try it.

ciao ...pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Lun, Gennaio 19, 2009 22:30, boesiii wrote:

 PG


 I added the script and the button control but I am not sure about the
 third
 item you mentioned.  I added the lines input type=hidden name=imgxy
 value=[center] /
 input type=hidden name=zoom value=2 / in the mapserver variables
 section but when I click the button nothing happens?

 What is the problem?




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] How to Remove Layer

2009-01-16 Thread Pietro Giannini
?php
$layerObj = $mapObj-getLayerByName(NameOfTheLayer);
$mapObj-removeLayer($layerObj-index);
?
C# is similar.

ciao
..pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


On Ven, Gennaio 16, 2009 07:09, Venkat Rao Tammineni wrote:
 Dear All,



   How to remove layer based on not based on index. Is it possible to
 remove
 layer based on name.



 I am waiting for your great response.



   Advanced Thanks



 Regards

 Venkat.

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Is there a way to add a single click zoom button

2009-01-15 Thread Pietro Giannini
Yes, but using some javascript in template html.

if you want to zoomin 2x:

script language=JavaScript
 function zoom2x()
 {
document.forms['mapserv'].imgxy.value = [mapwidth]/2 +   + 
[mapheight]/2;
document.forms['mapserv'].zoom.value = 2;
document.forms['mapserv'].submit();
 }
/script

called from a button control:
input type=button value=zoom in 2 X onclick=javascript:zoom2x();

assuming that you have an hidden field named 'imgxy' and a control
(select, radio, another hidden fiedl...) named 'zoom' in a form named
'mapserv'.

ciao
...pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Mer, Gennaio 14, 2009 18:34, boesiii wrote:

 by just using the map file and html template file.
 --
 View this message in context:
 http://n2.nabble.com/Is-there-a-way-to-add-a-single-click-zoom-button-tp2158109p2158109.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] How to add point based on User interaction using C#

2008-11-28 Thread Pietro Giannini
Hi Venkat.

I found this tutorial very useful:

http://www.paolocorti.net/public/wordpress/index.php/2006/09/20/mapserver-tutorial-for-c-mapscript-asp-net/

It is exactly what you want, unfortunately it is not reachable now, maybe
a temporary server failure...

I made the same in php_mapscript, db was mysql. You have to do the porting:

___

// get the click point in pixel coordinates
// the imagebutton of the map is named mapimg
$clickX = $_REQUEST[mapimg_x];
$clickY = $_REQUEST[mapimg_y];

// create a pointobject and store coordinates in projected units
$ppPoint = ms_newpointobj();
$ppPoint-setXY(($oMap-extent-minx + ($oMap-cellsize * $clickX)),
   ($oMap-extent-maxy - ($oMap-cellsize *
$clickY)));

// create a lat lon projection
$olatlonProj = ms_newprojectionobj(proj=latlong,ellps=WGS84);

// get the map projection
$osProj = $oMap-getProjection();
$omapProj = ms_newprojectionobj($osProj);

// project the point in EPSG 4326, latlon wgs84
$ppPoint-project($omapProj,$olatlonProj);

// insert
$sql = INSERT INTO pushpins (lon,lat) VALUES ;
$sql .= (.$ppPoint-x.,.$ppPoint-y.);
$myconn = mysql_connect(mysql_host,mysql_user,mysql_pw);
mysql_select_db(mysql_db);
$res = mysql_query($sql);

// all done.
// only now redraw the map
$oImage = $oMap-draw();
$sImageUrl = $oImage-saveWebImage();
___


I hope this is useful

ciao
... pg




On Ven, Novembre 28, 2008 09:09, Venkat Rao Tammineni wrote:
 Dear All,



I want  to add point based on user click on the map.That point has to
 store in Postgresql/PostGIS.Is there anyone has done the same task.Please
 help me.



 It is urgent for me .please any can help me.or please guide me .



 I am waiting for your great response.





 Advanced Thanks

 Venkat.



 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Re: php mapscript objects in session?

2008-11-24 Thread Pietro Giannini
Dear List,
I would like to open a little debate about the objects persistence in a
session.

I found objects persistence very useful and, in my little experience, I
get no problems like sharing objects across different sessions or data
loss.
In fact I entrust the thread safety systems of the environment, and I
don't lock threads at application level.

Methods to make persistent mapscripts objects in sessions vary according
to the web engine used. I know only php and ASP.NET environments: php can
only store primitives as strings, floats, integers; ASP.NET can instead
store instanciated objects, like mapscript objects.
In fact, php don't store the variables in memory but write a session file
to re-read on the next postback, so the app must to re-istanciate the
object according to a saved set of parameters, like extent-coordinates,
layers status ...

So I'm a bit amazed (read: worried) reading recent posts like:

 And even if it was possible it is NOT recommended to reuse mapscript
 objects across requests...

 Ah, MapScript object persistence... the restless leg syndrome of
 MapServer. Though neither convenient nor pretty, the One True Way
 (TM) to persist MapScript objects is the mapfile format.  Every other
 approach will just cause hair loss, unexplained rashes, nausea, and
 memory leakage.

Why you don't recommend this methods? can you pls share your experience,
before my hairs fall :) ?

regards .. pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] php mapscript objects in session?

2008-11-21 Thread Pietro Giannini
according to my little knowledge, php cannot store an instance of an
object in a session, only primitives variables like strings, integers,
floats and arrays (asp.net instead can).

for your app you must save the context (mapfile path, the extent, the
layers status etc.), and re-instance the map object at each postback.

hth

pg



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Ven, Novembre 21, 2008 00:33, Christopher Condit wrote:
 Hi-
 I'm using ms4w 2.2.7 and I've run into a problem. Ideally I'd like to
 create the MapScript map object and store it in the session:

 $_SESSION['map'] = ms_newMapObj($getMapPath);

 This works fine for the that page, for the first call, but when I
 attempt to reference it later I get a PHP error:
 Fatal error: Object has an invalid _handle_ property

 Am I missing something here?

 Thanks,
 -Chris

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Create a file GML from a layer of type annotation.

2008-11-20 Thread Pietro Giannini
Ciao José.

You can get the WFS layer in a free desktop GIS, like QGis (qgis.org) via
a default plugin which must be activated, and then export in shapefile.

If you need GML use ogr2ogr; qgis also has a converter plugin, but I never
used - be careful to GML version...

Hope this help

ciao
  pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Gio, Novembre 20, 2008 14:30, José María Michia wrote:
 Hi,

 I want to create a data file, in GML, starting with a layer of type
 annotation generated by MapServer as WFS.

 I've only been able to create the file GML using LAYER- TYPE = POLYGON.
 This does not serve me, because it includes all the elements of the layer.
 I
 want a layer that contains only the items that MapServer decided that
 should be labeled.

 The goal is to use data from the labels in other programs. So, other GIS
 formats can be fine.

 Thanks for any advice.
 José María
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] C# mapscript: create features programmatically

2008-11-19 Thread Pietro Giannini
Ciao list.

Anyone knows how to add dynamically a feature in a layer, working in
cshap_mapscript?

I must to add programmatically this features, without adding them to the
layer source.

Following code don't works... i.e. the new feature is not showing
(map is a valid MapObject, shp a valid ShapeObject, kriging is a valid
layer name, type of layer and kind of shape is line)


layerObj kl = map.getLayerByName(kriging);
kl.addFeature(shp);
imageObj imgMap = map.draw();
string fname = Guid.NewGuid().ToString();
string imgpath = map.web.imagepath + @\ + fname + .jpg;
if (File.Exists(imgpath)) File.Delete(imgpath);
imgMap.save(imgpath, map);


many thanks for your help.
ciao   ..pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] The browser can't display the rendered image

2008-11-19 Thread Pietro Giannini
Ciao Attila,

the IMAGEURL cannot be 'c:/ms4w/tmp/ms_tmp/', it would be something like
'/tmp/ms_tmp/', a URL not a local path.

ciao. pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Mer, Novembre 19, 2008 12:05, Attila Borbás wrote:
 Hello,

 Thanx for the previous answer. I ve tested my mapfiles (with quickmap.php)
 and they work fine, but the problem is the same. My php/mapscript code
 created the map image and saved it to /ms_tmp/ but the browser couldn't
 display it (I got a broken img). I enclose the php/mapscript file, the
 mapfile and the page source.Thx for ur help.

 *mapfile (I created it with qgis):*
 MAP
   NAME world_raster
   SIZE 600 600
   UNITS dd

   EXTENT -188.678212 -114.270312 189.321981 107.893344
   PROJECTION
 'proj=longlat'
 'ellps=WGS84'
 'datum=WGS84'
 'no_defs'
 ''
   END

   IMAGECOLOR 192 192 192
   IMAGEQUALITY 95
   IMAGETYPE jpeg
   OUTPUTFORMAT
 NAME jpeg
 DRIVER 'GD/JPEG'
 MIMETYPE 'image/jpeg'
 #IMAGEMODE PC256
 EXTENSION 'jpeg'
   END
   LEGEND
   IMAGECOLOR 255 255 255
 STATUS ON
 KEYSIZE 18 12
 LABEL
   TYPE BITMAP
   SIZE MEDIUM
   COLOR 0 0 89
 END
   END


   WEB

 IMAGEPATH 'c:/ms4w/tmp/ms_tmp/'
 IMAGEURL 'c:/ms4w/tmp/ms_tmp/'

 METADATA
   'wms_title'   'world_raster'
   'wms_onlineresource'
 'http://my.host.com/cgi-bin/mapserv?map=wms.map;
 '
   'wms_srs' 'EPSG:4326'
 END

   END

   LAYER
 NAME 'world_raster'
 TYPE RASTER
 DATA 'c:/ms4w/Apache/htdocs/world_raster.tif'
 METADATA
   'wms_title' 'world_raster'
 END
 STATUS DEFAULT
 TRANSPARENCY 100
 PROJECTION
 'proj=longlat'
 'ellps=WGS84'
 'datum=WGS84'
 'no_defs'
 ''
 END
   END

 END
 *php/mapscript code:*
 ?php
 define( MAPFILE, C:/ms4w/apps/raster/raster.map );
 define( MODULE, php_mapscript.dll );
 if(!extension_loaded(mapscript)) dl(MODULE);
 $oMap = ms_newMapObj( MAPFILE );
 //draw
 $oImage = $oMap-draw();
 //output map
 $url = $oImage-saveWebImage();
 ?
 HTML
HEAD
   TITLEExample 1: Displaying a map/TITLE
   /HEAD
   BODY
   IMG SRC=?php echo $url; ?
   /BODY
 /HTML

 *Page source (after I ran the code the html part saw the link to the image
 but didn't display it.):*
 HTML
 HEAD
 TITLEExample 1: Displaying a map/TITLE
 /HEAD
 BODY
 IMG SRC=c:/ms4w/tmp/ms_tmp/4923f091_c84_0.jpeg
 /BODY
 /HTML
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] The browser can't display the rendered image

2008-11-19 Thread Pietro Giannini
Attila,
It is strange, because the IMAGEURL in mapfile is correct, but the html
generated from the script report IMG
SRC=c:/ms4w/tmp/ms_tmp/4923f091_c84_0.jpeg, i.e. a local path and not a
url.
The correct tag should be something like IMG
SRC=/tmp/ms_tmp/4923f091_c84_0.jpeg

Are you sure the mapfile of the script is the same you are editing?

ciao .pg

On Mer, Novembre 19, 2008 21:22, Attila Borbás wrote:
 Hello,

 I still have got a problem. I ve tested my mapfiles (with quickmap.php)
 and
 they work fine, but the problem is the same. My php/mapscript code created
 the map image and saved it to /ms_tmp/ but the browser couldn't display
 it
 (I got a broken img). I enclose the php/mapscript file, the mapfile and
 the
 page source.Thx for ur help and patience.

 PHP/MAPSCRIPT FILE:

 ?php
 define( MAPFILE, /ms4w/apps/raster/raster.map );
 define( MODULE, php_mapscript.dll );
 if(!extension_loaded(mapscript)) dl(MODULE);
 $oMap = ms_newMapObj( MAPFILE );
 //draw
 $oImage = $oMap-draw();
 //output map
 $url = $oImage-saveWebImage();
 ?
 HTML
HEAD
   TITLEExample 1: Displaying a map/TITLE
   /HEAD
   BODY
   IMG SRC=?php echo $url; ?
   /BODY
 /HTML

 MAPFILE (I created it with qgis):

 MAP
   NAME world_raster
   SIZE 600 600
   UNITS dd

   EXTENT -188.678212 -114.270312 189.321981 107.893344
   PROJECTION
 'proj=longlat'
 'ellps=WGS84'
 'datum=WGS84'
 'no_defs'
 ''
   END

   IMAGECOLOR 192 192 192
   IMAGEQUALITY 95
   IMAGETYPE jpeg
   OUTPUTFORMAT
 NAME jpeg
 DRIVER 'GD/JPEG'
 MIMETYPE 'image/jpeg'
 #IMAGEMODE PC256
 EXTENSION 'jpeg'
   END
   LEGEND
   IMAGECOLOR 255 255 255
 STATUS ON
 KEYSIZE 18 12
 LABEL
   TYPE BITMAP
   SIZE MEDIUM
   COLOR 0 0 89
 END
   END


   WEB

 IMAGEPATH '/ms4w/tmp/ms_tmp/'
 IMAGEURL '/tmp/ms_tmp/'

 METADATA
   'wms_title'   'world_raster'
   'wms_onlineresource'
 'http://my.host.com/cgi-bin/mapserv?map=wms.map;
 '
   'wms_srs' 'EPSG:4326'
 END

   END

   LAYER
 NAME 'world_raster'
 TYPE RASTER
 DATA '/ms4w/Apache/htdocs/world_raster.tif'
 METADATA
   'wms_title' 'world_raster'
 END
 STATUS DEFAULT
 TRANSPARENCY 100
 PROJECTION
 'proj=longlat'
 'ellps=WGS84'
 'datum=WGS84'
 'no_defs'
 ''
 END
   END

 END

 Page source (after I ran the code the html part saw the link to the image
 but didn't display it.):

 HTML
 HEAD
 TITLEExample 1: Displaying a map/TITLE
 /HEAD
 BODY
 IMG SRC=c:/ms4w/tmp/ms_tmp/4923f091_c84_0.jpeg
 /BODY
 /HTML
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] TRANSPARENCY PROBLEM

2008-11-17 Thread Pietro Giannini
Hi john,
simply omit the whole STYLE in the class, this make the layer transparent.
Or, if this seems dirty, set COLOR -1 -1 -1 and OUTLINECOLOR -1 -1 -1.
In fact the TRANSPARENCY 1 render a very faded layer, while TRANSPARENCY 0
is like TRANSPARENCY 100...

(TRANSPARENCY is deprecated in ms5, use OPACITY)

let me know, ciao
.pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Lun, Novembre 17, 2008 17:00, ntiamoah bernard wrote:
 Hi guys,
 I need suggestions for the following problem:
  
  I want to put transparency on polygon layer so that aerial photo could be
 seen below it. I have tried TRANSPARECY and OPACITY but i only get faded
 not transparent layer. My imagetype is PNG. Here is the mapfile
  
 MAP
  NAME 'School_boundary'
  SIZE 800 650
  STATUS ON
  EXTENT  347683.125124 1652890.274125 458837.845673 1759026.124282
  UNITS feet
  FONTSET '../fonts/fonts.list'
  SYMBOLSET '../symbols/symbol.sym'
     OUTPUTFORMAT
     NAME 'png'
     DRIVER GD/PNG
     IMAGEMODE RGBA
     EXTENSION png
     FORMATOPTION FULL_RESOLUTION=TRUE
     FORMATOPTION INTERLACE=OFF
     TRANSPARENT ON
     END #end outputformat
  #IMAGETYPE PNG
  QUERYMAP
   STATUS ON
   STYLE SELECTED
  END
  WEB
    IMAGEURL /ms4w/tmp/ms_tmp/
    IMAGEPATH /ms4w/tmp/ms_tmp/
  END
  LEGEND
   STATUS ON
  END

   LAYER
     NAME 'School_district'
     TYPE POLYGON
     DATA
 '/ms4w/apps/GeoMOOSE/maps_countydemo/social_service/school_boundaries.shp'
     METADATA
   'wms_title' 'school_boundary'
     END
     STATUS DEFAULT
     TRANSPARENCY 20
     #MAXSCALE 200
     LABELITEM 'NAME'
     CLASS
    NAME 'esn_boundary'
    STYLE
  SYMBOL 0
  SIZE 2
  OUTLINECOLOR 0 255 170
  COLOR 224 255 255
    END
  LABEL
   TYPE TRUETYPE
   FONT arial
   SIZE 8
   COLOR 233 122 100
   ANGLE 0
   POSITION CC
   MINDISTANCE 250
   BUFFER 1
   WRAP  
  END
     END
   END
 END
  
 Thanks
 John
 Indiana


   ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] float raster

2008-11-14 Thread Pietro Giannini
Hi list,

anyone is experienced about creating raster on-the-fly in a mapscript
application?

I generate a regular grid of georeferenced values (floats) and I want to
display this values as raster, classifying the values using a colorrange.
Can mapserver read an ascii grid as datasource? if not, in your experience
which format is the best?

thanks for any hint.

ciao
..pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Tracking vehicles, Displaying positions

2008-11-05 Thread Pietro Giannini
Hi Carmelo,
it's no mode to know the projection of a dwg from itself: you have to ask
those who produced.
Once you have defined the projection and converted the dwg into .shp, you
must to create a mapfile with a layer which data is the shapefile. Another
layer will be the point layer of the vehicles.

If you are newbie of mapserver, take a look to the New Users section of
the site (http://mapserver.gis.umn.edu/new_users), it's very useful.

ciao
.pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Mer, Novembre 5, 2008 17:04, Carmelo Saffioti wrote:
 Thank you Pietro.
 Before converting from DWG to DXF, I have to say that my DWG planimetry is
 not georeferenced. How can I georeference it?
 After georeferencing it, how can I import the file on the map server? It
 will be the map, isn't it?


 Thank you again
 Cheers
 Carmelo



 dxf2shp (http://www.spatialorder.com/downloads.htm).
 You have first to convert the dwg in dxf:
 http://www.autodwg.com/DWG_DXF_Converter/ is a 15-days trial,
 http://www.a9tech.com/products/a9converter/ is free...

 there is also cad2shape: http://www.guthcad.com/cad2shape.htm, another
 trial version.

 there is a lot of tools:
 http://www.google.com/search?q=convert+dwg+to+dxf

 ciao
 ...pg


 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E



 On Mer, Novembre 5, 2008 11:39, Carmelo Saffioti wrote:
  Thank you Venkat for your reply,
  it's interesting to know that it's possible to access coordinates data
  directly from the MySql db...
  but before displaying points on the map, I need to understand how can
 I
  create a map from my planimetry DWG cad file...
 
  I hope you can help me
  Cheers
  Carmelo
 
 
  Hi,
 
 1)There are different ways to place GPS points on map.
   a)  You can display points using OGR direct connection, Please
 refer
  below url
 
 http://mapserver.gis.umn.edu/docs/howto/ogrmysql/?searchterm=ovf
 
 
 http://mapserver.gis.umn.edu/docs/howto/debian-odbc-mysql/?searchterm=ovf
 
 
 http://mapserver.gis.umn.edu/docs/reference/vector_data/VirtualSpatialData/?searchterm=ovf
 
  2)And You can not create DWG file by using mapfile.Mapfile will give
 you
  image format.
  Please have a look below url.
 
http://mapserver.gis.umn.edu/docs/reference/vector_data/format_types
 
  I hope this helps you.
 
  Thanks,
  Venkat
 
 
 
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Carmelo
  Saffioti
  Sent: Wednesday, November 05, 2008 2:30 PM
  To: mapserver-users@lists.osgeo.org
  Subject: [mapserver-users] Tracking vehicles, Displaying positions
 
  Hi everybody,
  I need to develop a system for tracking and displaying vehicles
  positions. I'm storing NMEA gps sentences into a MySql DB. Now I'd
  like to display these positions on a map. How can I do? I'm new to
  this, can you give me any suggestion?
  I have to create the map too, because this zone is not mapped. Is it
  possible to create a map from a DWG cad file?
 
  I hope you can help me
  Cheers
  Carmelo
 
  ___
  mapserver-users mailing list
  mapserver-users@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/mapserver-users
 



 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[Fwd: Re: [mapserver-users] symbolize a wms map based upon a sql count() query]

2008-10-30 Thread Pietro Giannini
I tried, this sample work.

SELECT countries.id, countries.name, count(related_table.*) FROM
countries, related_table WHERE countries.id = related_table.country_id
GROUP BY countries.id, countries.name

pg




-- Messaggio originale ---
Oggetto: Re: [mapserver-users] symbolize a wms map based upon a sql
count()  query
Da:  Pietro Giannini [EMAIL PROTECTED]
Data:Gio, Ottobre 30, 2008 11:22
A:   mapserver-users@lists.osgeo.org
Cc:  Scott Pezanowski [EMAIL PROTECTED]
--

Maybe a view on postresql, with both count and geometry?
can you pls post a little sample data?
ciao
pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Gio, Ottobre 30, 2008 03:52, Scott Pezanowski wrote:
 Hi,

 I am hoping to be able to symbolize a WMS or image map, based upon the
 results of a SQL COUNT() query. To be more specific, this query needs to
 be dynamic based upon user input from my application for specific
 attributes in the data, count up the number of records that meet that
 query, and then produce a choropleth map of the resulting counts. So the
 query would produce, a count of 10 records for one county, 5 records for
 another county, etc. and my counties will be colored based upon a scheme
 for these counts. My data is in a PostGIS database.

 Is there a way to do this with Mapserver? I am currently simply returning
 all of the records that meet my criteria and counting things up on the
 client application. But I am hoping there is a way to do this on the
 server or database-side of things.

 Thank you very much in advance for any help or tips you may be able to
 offer. Also, please let me know if you need more info on what I am trying
 to do.

 Thanks,
 Scott




 * Scott Pezanowski


 email: [EMAIL PROTECTED]
 *
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] symbolize a wms map based upon a sql count() query

2008-10-30 Thread Pietro Giannini
Hi scott,

 In summary, the first thing I would like to do is count the number of
 votes for 'A', and count the number of votes for 'B', both per county and
 based upon a user entered datesubmitted range;

a query like this:

SELECT countyid,vote,count(*) as count
FROM votes
WHERE vote='A'
GROUP BY countyid, vote
ORDER BY count desc, countyid asc

allow you to count the votes for 'A'. You can relate the query with the
response table adding a where clause on responseid and then filter by
the 'datesubmitted' field:

SELECT  countyid,vote,count(*) as votes_for_A
FROM votes, response
WHERE vote='A'
AND response.responseid = votes.responseid
AND response.datesubmitted BETWEEN lower datetime AND upper datetime
GROUP BY countyid, vote
ORDER BY count desc, countyid asc

now you can simbolize the map according to the votes_for_A alias field.

 produce a percentage of votes for 'A', per county, based upon the total
 votes for A and B for each county.

How to obtain this with a single query, is a little over my knowledge.
I'll try to find...

ciao
pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E





On Gio, Ottobre 30, 2008 15:54, Scott Pezanowski wrote:
 Hi Pietro,

 Thank you for your response. Sure, I will try below to add some sample
 data that illustrates what I am trying to do. I have a votes table which
 has a vote for each county (A versus B). This can be joined by a
 responseid to a table response, which has the date in which the votes
 were submitted. Also, countyid references my geometry in a separate table.
 In summary, the first thing I would like to do is count the number of
 votes for 'A', and count the number of votes for 'B', both per county and
 based upon a user entered datesubmitted range; And then symbolize my map
 based upon these results. Also, and I guess ideally, I'd like to also
 produce a percentage of votes for 'A', per county, based upon the total
 votes for A and B for each county. And then color code my counties based
 upon this percentage.

 Thank you for help you may provide.

 Scott

 Below is some sample data:

 votes table:

 countyid;vote;responseid
 1;B;296532B5A40C493592C9E6B480E15E37
 2;A;296532B5A40C493592C9E6B480E15E37
 3;B;296532B5A40C493592C9E6B480E15E37
 4;B;296532B5A40C493592C9E6B480E15E37
 5;B;296532B5A40C493592C9E6B480E15E37
 6;B;296532B5A40C493592C9E6B480E15E37
 7;B;296532B5A40C493592C9E6B480E15E37
 8;B;296532B5A40C493592C9E6B480E15E37
 9;A;296532B5A40C493592C9E6B480E15E37
 10;B;296532B5A40C493592C9E6B480E15E37
 11;B;296532B5A40C493592C9E6B480E15E37
 12;B;296532B5A40C493592C9E6B480E15E37
 13;B;296532B5A40C493592C9E6B480E15E37
 14;A;296532B5A40C493592C9E6B480E15E37
 15;B;296532B5A40C493592C9E6B480E15E37
 16;B;296532B5A40C493592C9E6B480E15E37
 17;B;296532B5A40C493592C9E6B480E15E37
 18;B;296532B5A40C493592C9E6B480E15E37
 19;B;296532B5A40C493592C9E6B480E15E37
 20;B;296532B5A40C493592C9E6B480E15E37
 21;B;296532B5A40C493592C9E6B480E15E37
 22;B;296532B5A40C493592C9E6B480E15E37
 23;A;296532B5A40C493592C9E6B480E15E37
 24;A;296532B5A40C493592C9E6B480E15E37
 25;A;296532B5A40C493592C9E6B480E15E37
 26;A;296532B5A40C493592C9E6B480E15E37
 27;B;296532B5A40C493592C9E6B480E15E37
 28;B;296532B5A40C493592C9E6B480E15E37
 29;B;296532B5A40C493592C9E6B480E15E37
 30;A;296532B5A40C493592C9E6B480E15E37
 31;B;296532B5A40C493592C9E6B480E15E37
 32;B;296532B5A40C493592C9E6B480E15E37
 33;B;296532B5A40C493592C9E6B480E15E37
 34;B;296532B5A40C493592C9E6B480E15E37
 35;A;296532B5A40C493592C9E6B480E15E37
 36;B;296532B5A40C493592C9E6B480E15E37
 37;A;296532B5A40C493592C9E6B480E15E37
 38;B;296532B5A40C493592C9E6B480E15E37
 39;A;296532B5A40C493592C9E6B480E15E37
 40;A;296532B5A40C493592C9E6B480E15E37
 41;B;296532B5A40C493592C9E6B480E15E37
 42;B;296532B5A40C493592C9E6B480E15E37
 43;A;296532B5A40C493592C9E6B480E15E37
 44;B;296532B5A40C493592C9E6B480E15E37
 45;B;296532B5A40C493592C9E6B480E15E37
 46;A;296532B5A40C493592C9E6B480E15E37
 47;B;296532B5A40C493592C9E6B480E15E37
 48;B;296532B5A40C493592C9E6B480E15E37
 49;B;296532B5A40C493592C9E6B480E15E37
 50;B;296532B5A40C493592C9E6B480E15E37
 51;A;296532B5A40C493592C9E6B480E15E37
 52;B;296532B5A40C493592C9E6B480E15E37
 53;B;296532B5A40C493592C9E6B480E15E37
 54;B;296532B5A40C493592C9E6B480E15E37
 55;B;296532B5A40C493592C9E6B480E15E37
 56;B;296532B5A40C493592C9E6B480E15E37
 57;B;296532B5A40C493592C9E6B480E15E37
 58;B;296532B5A40C493592C9E6B480E15E37
 59;B;296532B5A40C493592C9E6B480E15E37
 60;B;296532B5A40C493592C9E6B480E15E37
 61;B;296532B5A40C493592C9E6B480E15E37
 62;B;296532B5A40C493592C9E6B480E15E37
 63;A;296532B5A40C493592C9E6B480E15E37
 64;B;296532B5A40C493592C9E6B480E15E37
 65;B;296532B5A40C493592C9E6B480E15E37
 66;B;296532B5A40C493592C9E6B480E15E37
 67;B;296532B5A40C493592C9E6B480E15E37
 1;B;AE2E9A609C65420A9DDF37A9E56A25A8
 2;B;AE2E9A609C65420A9DDF37A9E56A25A8
 3;A;AE2E9A609C65420A9DDF37A9E56A25A8
 4;A;AE2E9A609C65420A9DDF37A9E56A25A8
 5;A;AE2E9A609C65420A9DDF37A9E56A25A8
 6;A;AE2E9A609C65420A9DDF37A9E56A25A8

Re: VS: [mapserver-users] projection = geographer's pain

2008-10-27 Thread Pietro Giannini
there is something strange... :-)

I normally project data in lat-lon wgs84 coordinates in world mercator.

I declare latlon wgs as
epsg:4326
or
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
and world mercator as
+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84
+datum=WGS84 +units=m +no_defs
(http://spatialreference.org/ref/epsg/3395/)

You use another declaration, that is the google mercator
(http://spatialreference.org/ref/user/google-projection/) that is slightly
different... I don't know well Proj4, but I believe that this is not the
core of the problem...

I know (maybe I do not know well) that the projection of the map is
different from the projection of the layer bcause the layer data source
(shapefile, postgis...) can be data with coordinates referred to a spatial
reference which can be different from the spatial reference of the map.

This allow mapserver to combine data coming from different source in a
single map.

If not declared, the LAYER inherits the PROJECTION of the map.

So, if yo have data in a projection and you want to project them in
another, all you have to do is correctly declare both PROJECTION section:
in the MAP and in LAYER.

obviously you must to set correctly the EXTENT and the UNIT of the MAP,
according to the PROJECTION of MAP, otherwise you will obtain a wrong part
of the map from the mapserver.
e.g.: if you have a PROJECTION latlon wgs84 the extent of the entire world
is -180 -90 180 90 and units is DD, if the projection is world
mercator the extent is -2000 -2000 2000 2000 (from my
experience!) and units is meters.

( If someone can explain me the difference from world mercator and google
mercator, and more generally can explain the parameters of proj4, I'll be
eternally grateful! )

Hope this help
pg



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Lun, Ottobre 27, 2008 12:46, Rahkonen Jukka wrote:
 Hi,

 Have you double-checked that your map extent correspods with the map
 projection?
 Or if you could send your whole mapfile I am pretty sure that you will get
 a final answer to your problem.

 -Jukka Rahkonen-

 -Alkuperäinen viesti-
 Lähettäjä: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Puolesta
 Monier Clement
 Lähetetty: 27. lokakuuta 2008 13:39
 Vastaanottaja: 'Pietro Giannini'; mapserver-users@lists.osgeo.org
 Aihe: RE: [mapserver-users] projection = geographer's pain


 Thanks for your answers Roger  Pietro.

 I've followed your advice by trying these 4 test-cases :

 1)
 Map proj set to :   init=epsg:3785 (web spherical Mercator,
 manually added
 into espg file)
 Layer proj set to : init=epsg:4326 (latlon wgs84, proj system of my
 shapefiles)

 = got a blank map

 2)
 Map projection set to : init=epsg:4326
 Layer projection set to : init=epsg:4326

 = got a map

 3)
 Map projection set to : init=epsg:3785
 Layer projection set to : init=epsg:3785

 = got the same map as 2)

 4)
 Map projection set to : init=epsg:4326
 Layer projection set to : init=epsg:3785

 = got a blank map

 I've also tried with another well-known existing epsg
 proj-system (instead of the manually-added 3785 code), but
 got the same results.
 I've made other attempts by replacing init=3785 by full
 description proj-string like +proj=longlat +ellps=WGS84
 +datum=WGS84 +no_defs  no_defs
 or +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
 +x_0=0.0 +y_0=0
 +k=1.0 +units=m [EMAIL PROTECTED]  no_defs
 But it didn't change anything...

 It seems that :
 - a map is drawn only if the map's and layer's proj-systems
 are the same.
 - the output projection is always overridden by the shapefile
 system, no re-projection is done anyway.

 Let me know if you have any further leads to solve this issue.

 Thanks for your help

 Clément

 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] De la part
 de Pietro Giannini Envoyé : vendredi 24 octobre 2008 21:40 À 
 : mapserver-users@lists.osgeo.org Objet : Re:
 [mapserver-users] projection = geographer's pain

 I can confirm that projection is often a pain!

 However, the problem may be in the projection of the layer.

 The PROJECTION section in a layer declare the projection of
 the data source of this layer, while the PROJECTION on the
 map level is the projection wich you want to show the whole
 map. So you can overlay more data sources in different
 projection in a single map.

 Try to set the layer PROJECTION as init=epsg:4326.
 Let us know...
 ciao
 ... pg


 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E




 On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
  Hi,
 
 
 
  I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.
 
  My datasource is shapefiles with WGS84 projection (epsg:4326).
 
  I would like MapServer to render these data into a Web (spherical)
  Mercator projected map (epsg:3785) in order to perfectly

Re: [mapserver-users] Clear projecton from layerObj

2008-10-24 Thread Pietro Giannini
You can not.
The layer object has always a projection. If not set in the PROJECTION
section of the layer in the mapfile, it assume the projection of the
mapfile.

You must assign to the layer object the projection of the map object:

layerObj.setProjection(mapObj.getProjection());

ciao
...pg



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Ven, Ottobre 24, 2008 17:46, Murty Maganti wrote:
 Hello



 How to remove (or clear) a projection information set to a layer using
 C# map script. For example, I have set a projection information to a
 layer using the code



 layerObj.setProjection(init=EPSG:4326);



 Now I want to clear this projection and set the layer to its original
 (unknown )status. I don't find any API on the layerObj to clear the
 projection information.





 Thanks

 Murty

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] projection = geographer's pain

2008-10-24 Thread Pietro Giannini
I can confirm that projection is often a pain!

However, the problem may be in the projection of the layer.

The PROJECTION section in a layer declare the projection of the data
source of this layer, while the PROJECTION on the map level is the
projection wich you want to show the whole map. So you can overlay more
data sources in different projection in a single map.

Try to set the layer PROJECTION as init=epsg:4326.
Let us know...
ciao
... pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
 Hi,



 I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.

 My datasource is shapefiles with WGS84 projection (epsg:4326).

 I would like MapServer to render these data into a Web (spherical)
 Mercator projected map (epsg:3785) in order to perfectly overlay the
 GoogleMaps tile images (for the moment, my maps are slightly shifted
 north.)



 I've added this string at the end of the file epsg in /ms4w/proj/nad :

 3785 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
 +y_0=0 +k=1.0 +towgs84=0,0,0,0,0,0,0 +units=m [EMAIL PROTECTED] +no_defs 



 But I don't know how to modify my request and mapfile in order to get the
 correct map.

 I've tried many combinations so far but with no success until now.



 Do I have to change the projection system of my shapefiles ?

 Is MapServer able to change projection between input and output ?



 Request : SRS=epsg:3785



 MapFile :



 [Map section]

   METADATA

 wms_srs   EPSG:4326 EPSG:3785 # is this correct ?

   END



 PROJECTION

init=epsg:3785 # is this correct ?

 END



 [Layer section]

   METADATA

 wms_srs   EPSG:3785 # is this correct ?

   END

   PROJECTION

init=epsg:3785 # is this correct ?

   END



 With these settings, the pictures I got from MapServer are still shifted.



 Thanks for your help



 Clement



 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] installing 2 ms4w versions on same server?

2008-10-22 Thread Pietro Giannini
Never tried, but why not? Pay attention to the ports (listen directive
in httpd.conf) which must be different, 80 (the default), 81, 82...

the url will be eg http://the.host:81/cgi-bin/mapserv.exe?.

On Mer, Ottobre 22, 2008 19:47, zach cruise wrote:
 if i setup httpd.conf right, can i unzip and use 2 ms4w versions (4.8
 and 5.2) on win2k3?
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] using php an oracle

2008-10-21 Thread Pietro Giannini
Are the two extensions present in the php extension directory? the
directory is defined in php.ini (extension_dir directive).
If yes maybe the extensions are of a different php version.

ciao

...pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Mar, Ottobre 21, 2008 10:39, fsalas wrote:
 hi, in this moment i have one problem , i need use the oracle spatial, php
 and mapserver but when i try to apache server have this error in a log
 file

 PHP Warning: PHP Startup: Unable to load dynamic library
 'C:\\apache\\PHP\\ext\\php_oci8.dll' - No se encontr\xf3 el proceso
 especificado.\r\n in Unknown on line 0.

 I use step by step this instruction Installing Oracle, PHP, and Apache on
 Windows 2000-XP.mht

 what's made bad?

 I attach the log file

 best regards, Francisco Salas


 ___
 Dpto de Sistemas Informáticos
 Oficina Central Grupo Empresarial GEOCUBA
 Este mensaje esta libre de virus.
 Revisado por Kaspersky Antivirus
 --
 Engine version:  4.0.1.14
 Engine date:  2002/06/25
 Definition count:  1191989
 Definition date:  2008/10/21
 MDAV version: 2.2.8

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] How to create mapfiles dynamically?

2008-10-15 Thread Pietro Giannini
http://www.mapstorer.org/

On Mer, Ottobre 15, 2008 08:25, ·ÅµY³Ç wrote:
 Hello:
If I want to show a map by Mapserver, I have to write a mapfile for it.
 Right?
Q1:How do I get the map information such as Layer?
Q2:If I want to let users upload their maps and show those maps by
 Mapserver, I must have those mapfiles.
 How to create those mapfiles dynamically?
 Thanks a lot.
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Dynamic SQL

2008-10-14 Thread Pietro Giannini
pls post the entire template, with javascript if exist.

ciao
pg


On Mar, Ottobre 14, 2008 09:42, mark balman wrote:
 Hi All

 Many thanks to Pietro Giannini and David Fawcett for your help but I
 am still struggling with getting a dynamic sql statement to work. I
 have gone back to trying a simple sql statement in the layer
 definition which works fine like this:

 LAYER
  CONNECTIONTYPE postgis
  NAME kbapoly
  CONNECTION user= password= dbname=kba host=localhost
  DATA the_geom from (select gid, intname, the_geom from kbapoly where
 intname = 'Tibesti massif') as myquery using SRID=4326 using unique
 gid
  STATUS OFF
  TYPE POLYGON
  TEMPLATE templates/kbas.html
  CLASS
   COLOR 255 0 0
  END
  HEADER templates/kbas_header.html
  FOOTER templates/kbas_footer.html
 END

 However, if I try the following

 LAYER
  CONNECTIONTYPE postgis
  NAME kbapoly
  CONNECTION user= password= dbname=kba host=localhost
  DATA the_geom from (select gid, intname, the_geom from kbapoly where
 intname = %qtest%) as myquery using SRID=4326 using unique gid
  STATUS OFF
  TYPE POLYGON
  TEMPLATE templates/kbas.html
  CLASS
   COLOR 255 0 0
  END
  HEADER templates/kbas_header.html
  FOOTER templates/kbas_footer.html
 END

 Together with the following in the template file:

 input type=hidden name=Name value=[qtest]

 pbIntName: /bbr
 textarea name=IntName rows=2 cols=5[qtest]/textarea
 p
 hr

 This returns the following error

 [Mon Oct 13 16:54:53 2008].386000 msDrawMap(): Image handling error.
 Failed to draw layer named 'kbapoly'.
 [Mon Oct 13 16:58:49 2008].733000 prepare_database(): Query error.
 Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE
 mycursor BINARY CURSOR FOR SELECT
 asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from
 (select gid, intname, the_geom from kbapoly where intname = %qtest%)
 as myquery WHERE the_geom  setSRID('BOX3D(-179.699499165275
 -120.200333889816,180.300500834725 119.599332220367)'::BOX3D, 4326 )'

 Postgresql reports the error as 'ERROR:  syntax error at or near %
 LINE 1: ...d, intname, the_geom from kbapoly where intname = %qtest%) a...

 Am I missing something obvious and doing something wrong?

 Any further suggestions would be gratefully received

 Thanks

 Mark
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Integrate mapserver with PHP MIS

2008-10-09 Thread Pietro Giannini
hallo Andre,
in a php environment you can query both PostgreSQL and MySQL data.

If you want click over a POI to read his data, your application should
query the MySQL MIS via the FeatureID and retrieve the budget data, then
display them in a window or in a layer on your web page.
It is different to show the POIs with a legend that depends of the budget
data: it is better if you can set up an ETL to import mysql data into
PostgreSQL, or vice versa only the X/Y coordinates of POIs from PostgreSQL
to MySQL. These solutions allows you to create a legend for the POIs, i.e.
a more exaustive classification of the POIs: not only grey  red but with
a color ramp.

Anoter way: you can to do this on the fly whit the php application,
adding programmatically the POIs that overspends to a red dots layer

I hope this can help

greetings
 pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

On Mer, Ottobre 8, 2008 21:26, Andre Schoonbee wrote:
 See, the map data is currently in postgis, and in the MySQL database, I
 have
 a FeatureID field that relates to the relevant PostGIS data element.

 I know this is doable, but my personal PHP development skills is extremely
 limited. I can setup mapserver and have got the basic  PHP system going,
 but
 going beyond - out of my current scope.

 -Original Message-
 From: Dan Little [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, October 08, 2008 8:47 PM
 To: Andre Schoonbee
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] Integrate mapserver with PHP MIS

 It is certainly possible to do this with mapserver.  More accurately, it
 is
 very easy to setup these types of queries with mapscript the scripting
 library provided with mapserver.

 There is also some constraints on your data.  You'll need to have a table
 (or column) describing the geographic locations of all of your projects.
 Or
 have a geocoder that can translate the project into geographic coordinates
 on the fly.



 - Original Message 
 From: Andre Schoonbee [EMAIL PROTECTED]
 To: mapserver-users@lists.osgeo.org
 Sent: Wednesday, October 8, 2008 12:41:33 PM
 Subject: [mapserver-users] Integrate mapserver with PHP MIS

 Hi List

 I want to get expert opinion on if mapserver would be the best platform
 for
 the following:

 I have a Management Information system (PHP, mySQL) and want to link it
 to
 a
 map. When I click on a POI on the map I want to see the projects at that
 POI, the staff or budget for that place. OR if I want to see all POI
 that
 overspend their budget, I want to display the POI as RED Dots on the
 map.

 Comments would be appreciated!

 And if this is a great platform, any developers out there willing to
 assist?

 Andre

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users





 __ Information from ESET Smart Security, version of virus
 signature
 database 3504 (20081008) __

 The message was checked by ESET Smart Security.

 http://www.eset.com


 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] dynamic sql mapserver

2008-10-09 Thread Pietro Giannini
Hi Mark.

I try...

1st one: add using SRID=4326 to the layer query;
2nd one: try to send - with some javascript - the entire query as
variable, not only the subquery, i.e. :

LAYER
...
DATA %sql%
...
END
on the mapfile and

script language='javascript'
function sendquery(subquery){
// code to complete the query string
document.forms['mainform'].sql.value = the_geom from ( +
subquery + ) as myquery using unique gid using SRID=4326;
document.forms['mainform'].submit();
}
/script
form name='mainform' ... 
input type='hidden' name='sql' value='[sql]'
textarea name= 'subquery' rows=3 cols=100/textarea
input type=button value='send'
onclick=javascript:sendquery(document.forms['mainquery'].subquery.value);
/form
on the html template.

let us know, ciao

pg




-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Gio, Ottobre 9, 2008 12:00, mark balman wrote:
 Hi all

 I am trying to figure out the way to create dynamic sql using
 mapserver (using the basic demo application under MS4W) and
 postgres/postgis. I have created various queries that work ok as
 follows:

 LAYER
  CONNECTIONTYPE postgis
  NAME qdistance
  CONNECTION user= password= dbname=test host=localhost
 DATA the_geom from (select * from kbapoly where
 st_distance(the_geom,GeomFromText('Point(1 0)',4326)) 6) as myquery
 using SRID=4326 using unique gid
  STATUS OFF
  TYPE POLYGON
  TEMPLATE templates/kbas.html
   CLASS
   COLOR 255 0 0

 What I would like to be able to do is pass user defined variables e.g.
 latitude, longitude and distance somehow. I have read various
 mapserver/postgis workshop docs by Paul Ramsey and others but cannot
 get anything to work. I have defined the Layer thus:

 LAYER
  CONNECTIONTYPE postgis
  NAME qdistance
  CONNECTION user= password= dbname=test host=localhost
  DATA the_geom from (%sql%) as myquery using unique gid STATUS OFF
  TYPE POLYGON
  TEMPLATE templates/kbas.html
   CLASS
   COLOR 255 0 0

 Within the basic.html page I have added the following:

 pbQuery: /bbr
 textarea name=sql rows=3 cols=100[sql]/textarea
 p

 When I try adding the sql statement to the text box

 select * from kbapoly where st_distance(the_geom,GeomFromText('Point(1
 0)',4326)) 6

 I keep getting the following message:

 msDrawMap(): Image handling error. Failed to draw layer named
 'qdistance'. prepare_database(): Query error. Error executing POSTGIS
 DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR
 FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text
 from (%sql%) as myquery WHERE the_geom 
 setSRID('BOX3D(-179.699499165275 -120.200333889816,180.300500834725
 119.599332220367)'::BOX3D, find_srid('','(%sql%) as
 myquery','the_geom') )' Postgresql reports the error as 'ERROR: syntax
 error at or near % LINE 1:
 ...ection(force_2d(the_geom)),'NDR'),gid::text from (%sql%) as ... ^ '
 More Help: Error with POSTGIS data variable. You specified 'check your
 .map file'. Standard ways of specifiying are : (1) 'geometry_column
 from geometry_table' (2) 'geometry_column from (sub query) as foo
 using unique column name using SRID=srid#' Make sure you put in the
 'using unique column name' and 'using SRID=#' clauses in. For more
 help, please see http://postgis.refractions.net/documentation/
 Mappostgis.c - version of Jan 23/2004.

 Can anyone provide me with some pointers?

 Many thanks

 Mark
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with a Share Point Portal.

2008-07-17 Thread Pietro Giannini
Tamas,
the error happens when I try to invoke an instance of mapserver:

   string v += OSGeo.MapServer.mapscript.msGetVersion();

In the c# project the mapscript_csharp.dll is referenced, and it is also
registred in the GAC

regards
. pg

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

On Mer, Luglio 16, 2008 21:46, Tamas Szekeres wrote:
 Pietro,

 Could you provide a code sample to investigate the problem in more detail?

 Best regards,

 Tamas

 2008/7/16 Pietro Giannini [EMAIL PROTECTED]:
 Hi all,

 I'm in serious trouble with the ambitious project of a web mapping app
 in
 a Windows SharePoint Services 3.0 environment; in detail, the
 application
 is embedded in a web part.
 Obviously, I'm developing in c#, that is not my preferred...

 I've recompiled myself mapserver and the mapscript_csharp assembly. In a
 debug environment all works fine but when I deploy the web part on the
 server I allways receive the same error:

 - Exception of type: System.TypeInitializationException;
 - with the message: The type initializer for
 'OSGeo.MapServer.mapscript'
 threw an exception;
 - the source: mapscript_csharp;
 - the InnerException.StackTrace is:
  -- at OSGeo.MapServer.mapscriptPINVOKE.MAX_ERROR_LEN_get()
  -- at OSGeo.MapServer.mapscript..cctor()

 If anyone has experienced the same or a similar problem, or has more
 experience than me, can please help me?

 thanks in advance.

 ..pg

 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users






___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Trouble with a Share Point Portal.

2008-07-17 Thread Pietro Giannini
Yes.

The strange is that another application, in a non SharePoint IIS, run well
with the precompiled binaries shipping in the ms4w package.
A Share Point portal (this is Share Point Services 3.0) however has a more
restrictive policy for the customized assemblies to deploy in, and an
assembly must to be registrered in the Global Assembly Cach and described
as safe control in the web.config of the site collection (the virtual
directory of site).
This is the reason I must to recompile the entire project: to have a
mapscript_csharp.dll strong-named to add it to GAC.

any idea?

many thanks
.. p


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Gio, Luglio 17, 2008 14:04, Venkat Rao Tammineni wrote:
 Hi,

   Have you replaced all dll(like libmap.dll etc..) into bin folder?

 Thanks and Regard
 Venkat.

 -Original Message-
 From: Pietro Giannini [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 17, 2008 5:25 PM
 To: mapserver-users@lists.osgeo.org
 Cc: Venkat Rao Tammineni
 Subject: RE: [mapserver-users] Trouble with a Share Point Portal.

 Venkat,
 this is the first I tried, don't work...

 In Visual Studio I can reference only the mapscript_csharp.dll, how can I
 reference a non-assembly .dll?

 regards
 ... pg


 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E



 On Gio, Luglio 17, 2008 06:17, Venkat Rao Tammineni wrote:
 Hi,

Take latest version of mapserver (Ms4W 2.7.7) and  update all the
 dlls
 form the cgi-bin to Visual Studio  add the reference from visual
 studio.It
 will work.There is only problem with version.Because I did the same.I
 think
 it will help you.

 Thanks and Regards
 Venkat.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Pietro
 Giannini
 Sent: Wednesday, July 16, 2008 10:05 PM
 To: mapserver-users@lists.osgeo.org
 Subject: [mapserver-users] Trouble with a Share Point Portal.

 Hi all,

 I'm in serious trouble with the ambitious project of a web mapping app
 in
 a Windows SharePoint Services 3.0 environment; in detail, the
 application
 is embedded in a web part.
 Obviously, I'm developing in c#, that is not my preferred...

 I've recompiled myself mapserver and the mapscript_csharp assembly. In a
 debug environment all works fine but when I deploy the web part on the
 server I allways receive the same error:

 - Exception of type: System.TypeInitializationException;
 - with the message: The type initializer for
 'OSGeo.MapServer.mapscript'
 threw an exception;
 - the source: mapscript_csharp;
 - the InnerException.StackTrace is:
  -- at OSGeo.MapServer.mapscriptPINVOKE.MAX_ERROR_LEN_get()
  -- at OSGeo.MapServer.mapscript..cctor()

 If anyone has experienced the same or a similar problem, or has more
 experience than me, can please help me?

 thanks in advance.

 ..pg

 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users







___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with a Share Point Portal.

2008-07-17 Thread Pietro Giannini
Tamas thanks, you are right!
1: the ms4w's mapscript_csharp.dll is strong-named (I tried to add a old
version to GAC);
2: with filemon I found the unlinked dll - mapscript, of course.

now all works

best regards
pietro

-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


On Gio, Luglio 17, 2008 14:43, Tamas Szekeres wrote:
 2008/7/17 Pietro Giannini [EMAIL PROTECTED]:
 Yes.

 The strange is that another application, in a non SharePoint IIS, run
 well
 with the precompiled binaries shipping in the ms4w package.
 A Share Point portal (this is Share Point Services 3.0) however has a
 more
 restrictive policy for the customized assemblies to deploy in, and an
 assembly must to be registrered in the Global Assembly Cach and
 described
 as safe control in the web.config of the site collection (the virtual
 directory of site).
 This is the reason I must to recompile the entire project: to have a
 mapscript_csharp.dll strong-named to add it to GAC.


 I'm not sure how the sharepoint process and security model is looking
 like. But what you've described shows as if the dependent unmanaged
 dll-s (eg. mapscript.dll) couldn't be accessed at run-time. You can
 use the dependency walker to inspect how the dll-s are linked to each
 other and use SysInternals filemon to see which dll cannot be accessed
 at run-time. You should find out the name of the host process running
 your application (eg. aspnet_wp.exe or w3wp.exe) and set up a filter
 to it in filemon. You might anyway have to try copying all of the
 dependent dll-s into the same directory where the host process is
 running.
 As far as I remember as of the 5-0 version the mapscript_csharp.dll is
 'strong-named' by default.


 Best regards,

 Tamas


 any idea?

 many thanks
 .. p


 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E



 On Gio, Luglio 17, 2008 14:04, Venkat Rao Tammineni wrote:
 Hi,

   Have you replaced all dll(like libmap.dll etc..) into bin folder?

 Thanks and Regard
 Venkat.

 -Original Message-
 From: Pietro Giannini [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 17, 2008 5:25 PM
 To: mapserver-users@lists.osgeo.org
 Cc: Venkat Rao Tammineni
 Subject: RE: [mapserver-users] Trouble with a Share Point Portal.

 Venkat,
 this is the first I tried, don't work...

 In Visual Studio I can reference only the mapscript_csharp.dll, how can
 I
 reference a non-assembly .dll?

 regards
 ... pg


 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E



 On Gio, Luglio 17, 2008 06:17, Venkat Rao Tammineni wrote:
 Hi,

Take latest version of mapserver (Ms4W 2.7.7) and  update all the
 dlls
 form the cgi-bin to Visual Studio  add the reference from visual
 studio.It
 will work.There is only problem with version.Because I did the same.I
 think
 it will help you.

 Thanks and Regards
 Venkat.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Pietro
 Giannini
 Sent: Wednesday, July 16, 2008 10:05 PM
 To: mapserver-users@lists.osgeo.org
 Subject: [mapserver-users] Trouble with a Share Point Portal.

 Hi all,

 I'm in serious trouble with the ambitious project of a web mapping app
 in
 a Windows SharePoint Services 3.0 environment; in detail, the
 application
 is embedded in a web part.
 Obviously, I'm developing in c#, that is not my preferred...

 I've recompiled myself mapserver and the mapscript_csharp assembly. In
 a
 debug environment all works fine but when I deploy the web part on the
 server I allways receive the same error:

 - Exception of type: System.TypeInitializationException;
 - with the message: The type initializer for
 'OSGeo.MapServer.mapscript'
 threw an exception;
 - the source: mapscript_csharp;
 - the InnerException.StackTrace is:
  -- at OSGeo.MapServer.mapscriptPINVOKE.MAX_ERROR_LEN_get()
  -- at OSGeo.MapServer.mapscript..cctor()

 If anyone has experienced the same or a similar problem, or has more
 experience than me, can please help me?

 thanks in advance.

 ..pg

 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users







 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users






___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapScript: HOW to get query result in NEW img

2008-06-27 Thread Pietro Giannini
Marco,

the querybypoint() method don't affect the extent of the map.

do you set in some part of your code the extent of the map?
I suppose in the html code you get the extent, e.g :

form name=main method=get action=?php echo $_SERVER['PHP_SELF']; ?
input type=hidden name=extent value=?php echo
$mapobj-extent-minx. .$mapobj-extent-miny.
.$mapobj-extent-maxx. .$mapobj-extent-maxy; ?

...

/form

to, in the postback, set the extent of the map with $mapobj-setextent() -
or zoompoint(), zoomrectangle(), zoomscale()...

without this setting the map is drawn in the extent defined in your mapfile.

maybe you have a zoom parameter set which influences the extent?

pls post the html code too.



On Ven, Giugno 27, 2008 15:55, Marco Foi wrote:
 I need to query a map and have the result displayed in a different image.
 BUT the main image is affected by the query and
 gets recentered on the SAME EXTENT of the query map.

 I'm using PHP MapScript

 Here is the 'core' of my code:

 // create a new point object at the clicked
 coordinates, to use it in queryByPoint
 $querypoint = ms_newPointObj();
 //$cy  $cy are the conversion in map units of
 the image coordinates of the queryed point on the map
 $querypoint-SetXY($cx, $cy);
 [...]
 //define the layer that will be queryed
 $layertoquery =$map-getLayerByName('geology');
 //perform the query
 $res = $layertoquery-queryByPoint($querypoint, MS_SINGLE,
 ($map-cellsize)*5);

 //FIRST draw the map image
 $image=$map-draw();
 $image_url=$image-saveWebImage();

 //THEN draw the query image
 $thequerymap = $map-drawQuery();
 $querymap_url=$thequerymap-saveWebImage();


 BUT $image_url IS AFFECTED by the query and
 displays che same extent of $querymap_url

 How can I avoid this?

 Marco



 At 18.48 25/06/2008, you wrote:
 
 Marco,
 I suppose you are using mapscript - php or other - in your application.
 The postback of your page send not only the click point, but - maybe -
 other parameters.
 Whit some javascript you can set a parameter wich tell your app not to
 affect the main map, but only the query map.

 Please post your code, html and scripts, for more specific help.

 ciao
 ..pg


 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E



 On Mer, Giugno 25, 2008 15:46, Marco Foi wrote:
   Hi all!
  
   I need to let the user queryByPoint (click) on a
   mainmap and get the result displayed on a
   second image WITHOUT influencing the mainmap.
  
   I tryed but the when i use the drawQuery() method
   it seems that also the mainmap is affected: it
   gets zoomed to the center of the feature (poligon) queryed.
   At the end the only difference between the two
   maps is that the image result of the query has
   the feature HILITED while the mainmap not.
  
   How can I avoid the problem?
  
   Marco Foi
  
   Dip. di Scienze della Terra A.Desio
   Sezione di Geologia e Paleontologia
   http://www.gp.terra.unimi.it
   Università degli Studi di Milano
   Via.Luigi Mangiagalli n.34 Cap.20133 Milano
   Laboratorio Informatico - Tel. 02- 503 15 503
   E-mail [EMAIL PROTECTED]
  
   ___
   mapserver-users mailing list
   mapserver-users@lists.osgeo.org
   http://lists.osgeo.org/mailman/listinfo/mapserver-users
  

 




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] QueryByPoint problem: why always the same feature?

2008-04-21 Thread Pietro Giannini
Carlo,
I think the cache is refreshed each call of $layer-queryByPoint(point,
mode, buffer).
Remember to set the mode = MS_MULTIPLE to obtain more than one result,
the point is a $pointObj in GEOGRAPHIC coordinates, the buffer set to 0
get the default of the TOLERANCE (in pixels) of the mapfile, otherwise you
can specify in ground units a circle around the point for obtain the
results.

Look here:
http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class
for a good guide about.

here a piece of code (it work):

$res = @$layer-queryByPoint($qpoint,MS_MULTIPLE,0);
if (@$layer-getNumResults()  0) {
$layer-open();
for ($i=0;$i$layer-getNumResults();$i++) {
$resCache = $layer-getResult($i);
$shape = $layer-getShape(-1,$resCache-shapeindex);
echo $shape-values['fieldname'].br;
//  etc.
}
$layer-close();
}

ciao
..pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E





On Lun, Aprile 21, 2008 13:20, Carlo Pelliconi wrote:
 Hi all.
 I use PHPMapScritp with Mapserver 4.10 on Debian Etch.
 I do a series of querybypoint, but the answer is always the first feature!
 I think it could be a resultCacheMember problem. How can I free all
 cache about previous query results?
 New results of next query are appended to previous results or getResult
 goes to a new set at any new query?
 It is sufficient to close the queried layer ad to free the
 $shp=getResult(...)?
 Thank you very much.
 Carlo

 --
 ing. Carlo Pelliconi
 [EMAIL PROTECTED]
 SIS.TER S.p.A.
 www.sis-ter.it
 via Mentana, 10
 40026 Imola (BO) Italy
 tel +39 0542 364034
 fax +39 0542 612130




 ATTENZIONE!
 Questo documento è indirizzato esclusivamente al destinatario. Tutte le
 informazioni ivi contenute, compresi eventuali allegati, sono soggette
 a riservatezza secondo i termini del D.Lgs. 196/2003 in materia di
 privacy e ne è proibita l'utilizzazione da parte di altri soggetti. Si
 ricorda che la diffusione l'utilizzo e/o la conservazione dei dati
 ricevuti per errore costituisce violazione di carattere penale ai sensi
 dell'art. 616 Codice penale (Violazione, sottrazione e soppressione di
 corrispondenza). Se avesse ricevuto per errore questo messaggio, La
 preghiamo cortesemente di contattare il mittente al più presto e di
 cancellare il messaggio subito dopo. Grazie.

 ATTENTION!
 This message is being sent from Sis.Ter S.p.A. and may contain information
 which is confidential or privileged. If you are not the intended
 recipient, please advise the sender immediately by reply e-mail and delete
 this message and any attachments without retaining a copy. Any
 unauthorized use of the content of this message is a breach of your duty
 to respect the confidentiality of the correspondence between other persons
 and can expose the responsible party to civil and/or criminal penalties
 (D.Lgs. 196/2003 Tutela della privacy e art. 616 Codice penale
 Violazione, sottrazione e soppressione di corrispondenza), and may
 constitute a more serious offence. Thanks.

 ACHTUNG!
 Dieses Dokument ist ausschließlich dem Empfänger vorbehalten. Die darin
 enthaltenen Informationen, auch jene in etwaigen Anlagen, gelten im Sinne
 des Dekrets Nr. 196/2003 in Sachen Privacy als streng vertraulich und
 dürfen von anderen Personen nicht verwende werden. Wer diese Mitteilung
 irrtümlicherweise erhält ist gebeten uns umgehend zu informieren und
 anschließend die Mitteilung zu vernichten. Vielen Dank.


 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] help: load a static map

2008-04-10 Thread Pietro Giannini
The Layer's STATUS is set to OFF, you must set on ON or DEFAULT to
activate it.

look here:
http://mapserver.gis.umn.edu/docs/reference/mapfile/layer.

Hope is useful.

ciao
pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Mer, Aprile 9, 2008 17:47, [EMAIL PROTECTED] wrote:
 Hi
 I'm a student and I’m starting my first application of MapServer
 with my own data following the tutorial and I already have the
 following problem.

 I have a very simple  shape data  in
 geographic/WGS84 and also UTM/WGS84 format; I have picked the extension
 using ARCGIS and I have tried a static visualization of my map as it is
 shown in the first example of the tutorial.


 MAP
   IMAGETYPE  PNG
 #   EXTENT -97.348976 41.619778 -82.122902 49.385620  #geo
 states
  EXTENT 12.238976 41.619778 13.122902 49.385620
 #geo rieti
 #   EXTENT 73306.04 -295414.39 1501200.05
 614634.59   #laea states
 #   EXTENT 28.0 466.0 376000.0
 4735000.0 #UTM/WGS84 rieti
   SIZE   1000 1000

 SHAPEPATH  /ms4w/apps/marco/data
   IMAGECOLOR 255 255 255


 # Start of LAYER DEFINITIONS
 -
   LAYER # States polygon
 layer begins here
   NAME comuni
   DATA comuni_rieti_ll
   STATUS   OFF
   TYPE POLYGON

   CLASS
   NAME
 comuni

   STYLE
   COLOR232 232 232
   OUTLINECOLOR
 32 32 32
  END
 END
   END # States polygon layer ends here


 I
 have tried the following things:
 - load my data  using the geographic
 coordinates (and corresponding extension);
 - load my data using  the
 UTM/WGS84 coordinates (and corresponding extension);
 - read the data
 through  the html-page or entering the URL  (http://localhost/cgi-
 bin/mapserv.exe?map=/ms4w/apps/marco/htdocs/example1-1.
 maplayer=statesmode=map)

 I always don’t have any error, but I only
 see the window in which the data should be visualised.

 It’s looks
 like the extension is wrong, but  I have checked my shape with ArcGis
 and also with Ogrinfo ….
 INFO: Open of `comuni_rieti_ll.shp'

 using driver `ESRI Shapefile' successful.

 Layer name: comuni_rieti_ll
 Geometry: Polygon
 Feature Count: 73
 Extent: (12.436251, 42.089346) -
 (13.409627, 42.740986)
 Layer SRS WKT:
 GEOGCS[GCS_WGS_1984,
 DATUM
 [WGS_1984,
 SPHEROID[WGS_1984,6378137,298.257223563]],

 PRIMEM[Greenwich,0],
 UNIT[Degree,0.0174532925199433]]
 AREA:
 Real (15.3)
 PERIMETER: Real (15.3)
 COD_AMM: Integer (9.0)
 COMUNE:
 String (35.0)
 PROVINCIA: String (20.0)
 CS_15: Integer (2.0)
 COD_REG:
 Integer (3.0)
 COD_PRO: Integer (3.0)
 COD_COM: Integer (3.0)


 What can
 be wrong and what other  can be done to solve the problem?

 Can
 anybody, please, help me?

 Bye Marco


 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users