Re: [mapserver-users] queryByAttributes on PostGIS-Layer
Found the problem (thanks to Nicol ;-) Code: @$myQuery = $layer-queryByAttributes('nr_','7', MS_SINGLE); must be changed to: @$myQuery = $layer-queryByAttributes('nr_','nr_=7', MS_SINGLE); Is this a bug? Sven - Original Message - From: [EMAIL PROTECTED] To: mapserver-users@lists.osgeo.org Sent: Wednesday, May 28, 2008 12:48 PM Subject: [mapserver-users] queryByAttributes on PostGIS-Layer Hallo list, My test-system: Mapserver 5.02 on WinXP and postgreSQL 8.2 I try to make some querys via php-mapscript for a postgis-layer: queryByPoint,queryByShape and queryByRect is no problem. queryByAttributes always return no result (field 'nr_' is an integer) If I use a shapefile for the same data (biogasanlagen.shp) queryByAttributes works fine. mapfile: ... LAYER NAME biogasanlagen TYPE point STATUS on CONNECTIONTYPE postgis CONNECTION user=postgres password=xyz dbname=mydb host=localhost port=5432 DATA the_geom from biogasanlagen using unique gid #DATA biogasanlagen.shp TEMPLATE void CLASS Name biogasanlagen OUTLINECOLOR 128 70 0 COLOR 230 70 0 SYMBOL 'circle' SIZE 12 END # CLASS TRANSPARENCY 88 TOLERANCE 8 END ... php-Code: ... $layer = $map-getLayerByName(biogasanlagen); @$myQuery = $layer-queryByAttributes('nr_','7', MS_SINGLE); ... any idea? Thanks Sven ___ 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] Displaying population density with Mapserver
Hi David, I tried WGS84 yesterday after a little research on projection, but it didn't change anything. I tried re-generating the shapefile with WGS84 projection but it's still the same. In fact, my data comes from GPW v3 ( http://sedac.ciesin.columbia.edu/gpw/global.jsp) but I didn't find any clue on the projection used, I suppose there is none as you say. When you speak about translating ground units, do you mean I have to translate my shapefile from degrees to, say, kilometers before I can use SIZEUNITS kilometers ? I thought it could be done dynamically by MapServer. I found a tutorial about this, I will try it anyway (assuming my data is WGS84) and give you the outcome :) I attached my mapfile this time, just in case I made a noob mistake somewhere... thank you very much ! Faldor 2008/5/28 Fawcett, David [EMAIL PROTECTED]: Faldor, When you have point coordinates stored in a text file, there really is no way to encode/attach the projection definition. Even if you could, it doesn't sound like you really know what spatial reference system (SRS) or projection that it is in. The key to projecting to another SRS or translating ground units to another measure (from degrees to meters) is knowing what the current SRS of the data is. Since your data is worldwide and it is unprojected (lat/lon), a good first guess would be to assume that it is unprojected with using the WGS84. Try defining your layer projection by including this block in your layer definition. PROJECTION init=epsg:4326 END David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pierre-Benoit Besse Sent: Wednesday, May 28, 2008 4:11 AM To: Fawcett, David Cc: mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Well, I confess, I'm new to GIS applications and I do not know a lot about projections. I understand I have to tell MapServer what is the projection of each layer I use in the mapfile, but using ogrinfo on my shapefiles tells me that : Layer name: pop_density Geometry: Point Feature Count: 249937 Extent: (-180.00, -56.00) - (179.75, 83.50) Layer SRS WKT: (unknown) latitude: Real (24.15) longitude: Real (24.15) densite: Real (24.15) I generated this shapefile from a CSV file with 3 columns : latitude, longitude, density_value. Did I have to define a projection then ? How do I do that ? Best regards, Faldor 2008/5/27 Fawcett, David [EMAIL PROTECTED]: Have you defined an output projection for your map and input projections for each of your layers? It is likely that MapServer needs to know what the input projection/SRS is before it can translate to different units. David. -Original Message- From: Pierre-Benoit Besse [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2008 11:26 AM To: Fawcett, David Cc: Ritesh Ambastha; mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Ha, well, I prefer that :) I would need a lot of layer definitions to obtain something ok... But I just tried the ground units stuff, I tried with a 50 kilometers wide square and it drew squares the size of ASIA !! oO I had to define a 1 feet wide square to obtain something more or less ok... Does anybody know why ? Aside from that It seems to work, thank you ! I will try the scalesymbol stuff tomorrow. Regards 2008/5/27 Fawcett, David [EMAIL PROTECTED]: Before you create lots of different layers to simulate symbol scaling, you may want to try something else. It has been a long time since I have played with scaled symbols, but give it a try. You should be able to scale the symbols by setting a SYMBOLSCALE in the LAYER object. This is the scale at which you want the symbol to appear at the SIZE stated in the map file. You may want to modify STYLE MAXSIZE if you think that you will want your symbols to be larger than 50 pixels. Another completely different approach that just came to my mind would be to use ground units (e.g. meters) to set the size of your symbol. To do this, set LAYER SIZEUNITS to meters. Calculate the size of a symbol in meters on the ground that will touch adjacent symbols, or give you the desired amount of space between the symbols. That way, the symbols should scale consistently. David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ritesh Ambastha Sent: Tuesday, May 27, 2008 10:16 AM To: mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Dear Faldor, Robert is absolutely right. You will have to make different LAYERS for the same POINT layer. But, define MAX/MINSCALE for each Layer. Change STYLE - SIZE values in each of the layer. You are done !! Cheers ! Ambastha Faldor wrote: Yes, but I need them to adapt for different extents.
[mapserver-users] Accessing raster cell values
Hello List, This question may be a general newbie GIS question and not solely related to Mapserver, so apologies if I'm posting to the wrong place. I am serving a GeoTiff via Mapserver using WMS, and displaying it using OpenLayers, so far so good. I need to be able to click on a point on the map and display the value held within that particular Raster cell. Can anyone suggest what mechanism I should use for this? WCS looks like it might be the thing I need, but I'm having difficulty finding much in the way of examples and instructions. I've followed what examples there are and all I can get Mapserver to return using WCS, is a Geotiff with every pixel set to zero. So I've obviously not got it working correctly, and even if it were I'm not sure how to get the information I need out of the returned Geotiff when my client is OpenLayers. Can anyone suggest a way to access a raster's values when it is served by Mapserver and viewed using OpenLayers? Thank you Andrew Mason ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
VS: [mapserver-users] Accessing raster cell values
Hi, I can't say anything about OpenLayest client, but you may find some other useful information from here: http://mapserver.gis.umn.edu/docs/howto/raster_data/#raster-query Basically I think that WMS GetFeatureInfo query might be close to what you are searching for. -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Puolesta Andrew Mason Lähetetty: 29. toukokuuta 2008 11:30 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: [mapserver-users] Accessing raster cell values Hello List, This question may be a general newbie GIS question and not solely related to Mapserver, so apologies if I'm posting to the wrong place. I am serving a GeoTiff via Mapserver using WMS, and displaying it using OpenLayers, so far so good. I need to be able to click on a point on the map and display the value held within that particular Raster cell. Can anyone suggest what mechanism I should use for this? WCS looks like it might be the thing I need, but I'm having difficulty finding much in the way of examples and instructions. I've followed what examples there are and all I can get Mapserver to return using WCS, is a Geotiff with every pixel set to zero. So I've obviously not got it working correctly, and even if it were I'm not sure how to get the information I need out of the returned Geotiff when my client is OpenLayers. Can anyone suggest a way to access a raster's values when it is served by Mapserver and viewed using OpenLayers? Thank you Andrew Mason ___ 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] International characters in text paramater
Didn't get it to work as it should. This works: TEXT test This does not work(no text at all in the map): TEXT Lysl#248;ype If we do this TEXT (Lysl#248;ype) mapserver does not understand the ASCII value and prints it out exactly as typed. Espen 2008/5/28 Frode Wiseth Jørgensen [EMAIL PROTECTED]: Hi Espen Try this: TEXT Lysl#248;ype FrodeWJ 2008/5/28 Espen Isaksen [EMAIL PROTECTED]: Hi! Tried to find a answer to this but was unable to. I am trying to use Norwegian characters in the text parameter in the class object. I set Text (Lysløype) in the map file but this does not work. How can I do this correctly? Example follows: LAYER # Lysloype NAME Lysloype TYPE line STATUS default DATA bygg/lysloype MAXSCALE 2 TRANSPARENCY 80 LABELMAXSCALE 2000 CLASS STYLE COLOR 255 255 0 # Gul farge. SYMBOL point_line SIZE 4 END STYLE COLOR 255 255 0 # Gul farge. SYMBOL normal_line SIZE 1 END TEXT (Lysløpe) LABEL SIZE 7 COLOR 255 255 255 OUTLINECOLOR 100 100 100 ANGLE follow POSITION cc TYPE truetype FONT Verdana_bold MINDISTANCE 100 PARTIALS false END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Frode Wiseth Jørgensen +47 99 03 41 42 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] SQL SELECT statement in a OGR connection (DGN)
Hi all, I´m do not how to use de SQL SELECT statement to select several values in a OGR connection to a DGN file with a layer named 'level'. For this layer, i´d like to select the values '1,3,5'. The object LAYER is posted below. Thanks in advanced. LAYER NAME sheet5000 STATUS ON TYPE line CONNECTIONTYPE OGR CONNECTION D:\sheet5000.DGN #how do i use the SQL SELECT statement? DATA level=1,5,7 STYLEITEM AUTO CLASS # Object Class void END PROJECTION init=epsg:4326 END METADATA wms_title wms_abstract xx wms_keywordlist xx wms_srs EPSG:4326 END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Accessing raster cell values
Hi, if you have access to the mapfile, you can make a queryByPoint with mapscript (i.e with an ajax-function) You have to send your point-coordinats to the script like this: $coord = split(',',$_POST[coord]); dl('php_mapscript.dll'); //load mapfile $map= ms_newMapObj($mapfilepath.'\yourmap.map'); //create point $qPoint = ms_newPointObj(); $qPoint-setXY($coord[0]*1,$coord[1]*1); //set layer $layer = $map-getLayerByName(your_rasterlayer); //Pointquery (Single) @$datQuery = $layer-queryByPoint($qPoint, MS_SINGLE, 1); //if success if ($datQuery == MS_SUCCESS) { for ($j=0; $j$layer-getNumResults(); $j++) { $result = $layer-getResult($j); $layer-open(); $shpobj = $layer-getShape($result-tileindex,$result-shapeindex); $attr = $shpobj-values; //echo round($attr[value_0],2); $rasterdata = round($attr[value_0],1); print 'My Data: '.$rasterdata.'; $shpobj-free(); } } else{ print 'no Data'; } Greetings Sven - Original Message - From: Andrew Mason [EMAIL PROTECTED] To: mapserver-users@lists.osgeo.org Sent: Thursday, May 29, 2008 10:29 AM Subject: [mapserver-users] Accessing raster cell values Hello List, This question may be a general newbie GIS question and not solely related to Mapserver, so apologies if I'm posting to the wrong place. I am serving a GeoTiff via Mapserver using WMS, and displaying it using OpenLayers, so far so good. I need to be able to click on a point on the map and display the value held within that particular Raster cell. Can anyone suggest what mechanism I should use for this? WCS looks like it might be the thing I need, but I'm having difficulty finding much in the way of examples and instructions. I've followed what examples there are and all I can get Mapserver to return using WCS, is a Geotiff with every pixel set to zero. So I've obviously not got it working correctly, and even if it were I'm not sure how to get the information I need out of the returned Geotiff when my client is OpenLayers. Can anyone suggest a way to access a raster's values when it is served by Mapserver and viewed using OpenLayers? Thank you Andrew Mason ___ 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] Accessing GDAL raster in MapServer
Hi! I'm trying to serve some CADRG (A.toc) data through MapServer, but I'm obviously doing something wrong because all I get is some error messages in the logfile. I'm currently using the latest MS4W release. This is how the mapfile looks like: MAP NAME Rendertest STATUS ON SIZE 800 500 DEBUG 4 #IMAGETYPE PNG #IMAGECOLOR 255 255 255 #SYMBOLSET c:/ms4w/sym/symbols/SKsym.sym #FONTSET c:/ms4w/sym/skfonts/font.list EXTENT -1 53 53 68 SHAPEPATH E:/RPF_test/ UNITS dd MAXSIZE 2048 RESOLUTION 96 PROJECTION init=epsg:4326 END WEB IMAGEPATH C:/ms4w/tmp/ms_tmp/ IMAGEURL /ms_tmp/ METADATA ows_schemas_location http://schemas.opengeospatial.net; ows_accessconstraints Copyright Statens kartverk 2007 wms_srs EPSG:4326 EPSG:27391 EPSG:27392 EPSG:27393 EPSG:27394 EPSG:27395 EPSG:27396 EPSG:27397 EPSG:27398 EPSG:3034 EPSG:32635 EPSG:32633 EPSG:32634 EPSG:32631 EPSG:32636 EPSG:32632 ows_exceptions_format application/vnd.ogc.se_xml END END LAYER NAME Test DEBUG 4 STATUS ON DATA rpf/a.toc TYPE RASTER #MINSCALE 300 #PROCESSING RESAMPLE=AVERAGE #PROCESSING RESAMPLE=BILINEAR #PROCESSING RPFTOC_FORCE_RGBA=TRUE METADATA wms_title Test END PROJECTION init=epsg:4326 END END END And this is the error message: [Thu May 29 12:11:41 2008].641000 CGI Request 1 on process 1516 [Thu May 29 12:11:41 2008].688000 msDrawRasterLayerLow(Test): entering. [Thu May 29 12:11:42 2008].125000 msResampleGDALToMap in effect: cellsize = 0.053997 [Thu May 29 12:11:42 2008].125000 msDrawGDAL(Test): using RAW_WINDOW=805 0 95841 47616 [Thu May 29 12:11:42 2008].125000 msDrawGDAL(): red,green,blue,alpha bands = 1,0,0,0 [Thu May 29 12:11:42 2008].125000 msDrawMap(): Image handling error. Failed to draw layer named 'Test'. [Thu May 29 12:11:42 2008].125000 msFreeMap(): freeing map at 01535F40 I would really appreciate any help on this issue? Regards, Pål Kristensen -- View this message in context: http://www.nabble.com/Accessing-GDAL-raster-in-MapServer-tp17532414p17532414.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
Re: [mapserver-users] SQL SELECT statement in a OGR connection (DGN)
Gabriela Messner wrote: Hi all, I´m do not how to use de SQL SELECT statement to select several values in a OGR connection to a DGN file with a layer named 'level'. For this layer, i´d like to select the values '1,3,5'. The object LAYER is posted below. Thanks in advanced. LAYER NAME sheet5000 STATUS ON TYPE line CONNECTIONTYPE OGR CONNECTION D:\sheet5000.DGN #how do i use the SQL SELECT statement? DATA level=1,5,7 Gabriela, I would suggest trying: CONNECTIONTYPE OGR CONNECTION D:\sheet5000.DGN DATA elements FILTER WHERE level in (1,5,7) With CONNECTIONTYPE OGR you can prefix your FILTER with the keyword WHERE and the rest will be passed through to OGR as an SQL style attribute filter. In DGN files there is only one layer, named elements, so we provide that in the DATA statement. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, [EMAIL PROTECTED] light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| President OSGeo, http://osgeo.org ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] International characters in text paramater
Tried a bit more, and strange things happen. Sometimes Mapserver just runs for a long time without creating a map. Other times it creates a map, but the letters are totally wrong. When using 248 for ø I do not get any text at all. Using 156 for æ I get this: http://bildr.no/view/205560 Appreciate it if anybody knows why this happens. Espen 2008/5/29 Espen Isaksen [EMAIL PROTECTED]: Didn't get it to work as it should. This works: TEXT test This does not work(no text at all in the map): TEXT Lysl#248;ype If we do this TEXT (Lysl#248;ype) mapserver does not understand the ASCII value and prints it out exactly as typed. Espen 2008/5/28 Frode Wiseth Jørgensen [EMAIL PROTECTED]: Hi Espen Try this: TEXT Lysl#248;ype FrodeWJ 2008/5/28 Espen Isaksen [EMAIL PROTECTED]: Hi! Tried to find a answer to this but was unable to. I am trying to use Norwegian characters in the text parameter in the class object. I set Text (Lysløype) in the map file but this does not work. How can I do this correctly? Example follows: LAYER # Lysloype NAME Lysloype TYPE line STATUS default DATA bygg/lysloype MAXSCALE 2 TRANSPARENCY 80 LABELMAXSCALE 2000 CLASS STYLE COLOR 255 255 0 # Gul farge. SYMBOL point_line SIZE 4 END STYLE COLOR 255 255 0 # Gul farge. SYMBOL normal_line SIZE 1 END TEXT (Lysløpe) LABEL SIZE 7 COLOR 255 255 255 OUTLINECOLOR 100 100 100 ANGLE follow POSITION cc TYPE truetype FONT Verdana_bold MINDISTANCE 100 PARTIALS false END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Frode Wiseth Jørgensen +47 99 03 41 42 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Problem with Label ...
Hi Guys... Take a look in the attached image ... Why is mapserver putting white space after text? In the database is everthing ok, with no space at all... ps.: I added BACKGROUNDCOLOR to label to show up the problem... Using latest ms4w compiled version for C# + oracle... My Mapfile: LAYER #6 NAME BASE GROUP x TYPE POINT STATUS ON CONNECTIONTYPE oraclespatial CONNECTION x/y DATA GEOM from GEO_BASE USING UNIQUE ID VERSION 10G LABELITEM NAME CLASS TEMPLATE dummy NAME BASES STYLE SYMBOL circle MINSIZE 9 MAXSIZE 9 COLOR 255 255 13 OUTLINECOLOR 0 0 0 END LABEL BACKGROUNDCOLOR X X X COLOR X X X FONT arial TYPE TRUETYPE SIZE 10 ANTIALIAS TRUE POSITION AUTO PARTIALS FALSE BUFFER 3 END END END attachment: Mapserver Label.GIF___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [MAPSERVER-USERS] Displaying population density with Mapserver
MapServer should do the conversion on the fly, my point was just that MapServer needs to know what SRS (and units) that the data is in, so it can make the translation. Can you post the text of your map file? David. -Original Message- From: Pierre-Benoit Besse [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2008 2:51 AM To: Fawcett, David Cc: mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Hi David, I tried WGS84 yesterday after a little research on projection, but it didn't change anything. I tried re-generating the shapefile with WGS84 projection but it's still the same. In fact, my data comes from GPW v3 (http://sedac.ciesin.columbia.edu/gpw/global.jsp) but I didn't find any clue on the projection used, I suppose there is none as you say. When you speak about translating ground units, do you mean I have to translate my shapefile from degrees to, say, kilometers before I can use SIZEUNITS kilometers ? I thought it could be done dynamically by MapServer. I found a tutorial about this, I will try it anyway (assuming my data is WGS84) and give you the outcome :) I attached my mapfile this time, just in case I made a noob mistake somewhere... thank you very much ! Faldor 2008/5/28 Fawcett, David [EMAIL PROTECTED]: Faldor, When you have point coordinates stored in a text file, there really is no way to encode/attach the projection definition. Even if you could, it doesn't sound like you really know what spatial reference system (SRS) or projection that it is in. The key to projecting to another SRS or translating ground units to another measure (from degrees to meters) is knowing what the current SRS of the data is. Since your data is worldwide and it is unprojected (lat/lon), a good first guess would be to assume that it is unprojected with using the WGS84. Try defining your layer projection by including this block in your layer definition. PROJECTION init=epsg:4326 END David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pierre-Benoit Besse Sent: Wednesday, May 28, 2008 4:11 AM To: Fawcett, David Cc: mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Well, I confess, I'm new to GIS applications and I do not know a lot about projections. I understand I have to tell MapServer what is the projection of each layer I use in the mapfile, but using ogrinfo on my shapefiles tells me that : Layer name: pop_density Geometry: Point Feature Count: 249937 Extent: (-180.00, -56.00) - (179.75, 83.50) Layer SRS WKT: (unknown) latitude: Real (24.15) longitude: Real (24.15) densite: Real (24.15) I generated this shapefile from a CSV file with 3 columns : latitude, longitude, density_value. Did I have to define a projection then ? How do I do that ? Best regards, Faldor 2008/5/27 Fawcett, David [EMAIL PROTECTED]: Have you defined an output projection for your map and input projections for each of your layers? It is likely that MapServer needs to know what the input projection/SRS is before it can translate to different units. David. -Original Message- From: Pierre-Benoit Besse [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2008 11:26 AM To: Fawcett, David Cc: Ritesh Ambastha; mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Ha, well, I prefer that :) I would need a lot of layer definitions to obtain
Re: [mapserver-users] Problem with Label ...
Hi Paul, I believe this was a bug that has fixed. What version of mapserver are you using? -Steve W Paul james wrote: Hi Guys... Take a look in the attached image ... Why is mapserver putting white space after text? In the database is everthing ok, with no space at all... ps.: I added BACKGROUNDCOLOR to label to show up the problem... Using latest ms4w compiled version for C# + oracle... My Mapfile: LAYER #6 NAME BASE GROUP x TYPE POINT STATUS ON CONNECTIONTYPE oraclespatial CONNECTION x/y DATA GEOM from GEO_BASE USING UNIQUE ID VERSION 10G LABELITEM NAME CLASS TEMPLATE dummy NAME BASES STYLE SYMBOL circle MINSIZE 9 MAXSIZE 9 COLOR 255 255 13 OUTLINECOLOR 0 0 0 END LABEL BACKGROUNDCOLOR X X X COLOR X X X FONT arial TYPE TRUETYPE SIZE 10 ANTIALIAS TRUE POSITION AUTO PARTIALS FALSE BUFFER 3 END END END ___ 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] Fatal error: Call to undefined function ms_newMapObj() in.........
Νίκος Παπαδάκης wrote: Hello. I try to use pamscript with php by running the following file but i receive the following error message: *Fatal error*: Call to undefined function ms_newMapObj() in *C:\ms4w\Apache\htdocs\phpms_hello.php* on line *5.* File name : phpms_hello.php in C:\ms4w\Apache\htdocs You get this because the php_mapscript.dll is not loaded in your PHP environment. One way to solve this is to load it using the dl() command at the beginning of your PHP script, e.g. ?php dl(php_mapscript.dll); ... ? Daniel -- Daniel Morissette http://www.mapgears.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Retrieve column names from getFeature ...
Hello all... I have this code in mapscript (c#): ... resultCacheMemberObj _result = _layer.getResult(i); _layer.open(); shapeObj _obj = _layer.getFeature(_result.shapeindex, _result.tileindex); _layer.close(); ... So, in my _obj.values I have a array with db data... Is it posible to get the column name ? thanks ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MAPSERVER-USERS] Displaying population density with Mapserver
ALRIGHT !! It was a noob mistake indeed, I did not specify UNITS in the MAP object. In fact I thought Mapserver could know it from the shapefile. Thank you very much, it works fine now :) Faldor 2008/5/29 Fawcett, David [EMAIL PROTECTED]: MapServer should do the conversion on the fly, my point was just that MapServer needs to know what SRS (and units) that the data is in, so it can make the translation. Can you post the text of your map file? David. -Original Message- *From:* Pierre-Benoit Besse [mailto:[EMAIL PROTECTED] *Sent:* Thursday, May 29, 2008 2:51 AM *To:* Fawcett, David *Cc:* mapserver-users@lists.osgeo.org *Subject:* Re: [MAPSERVER-USERS] Displaying population density with Mapserver Hi David, I tried WGS84 yesterday after a little research on projection, but it didn't change anything. I tried re-generating the shapefile with WGS84 projection but it's still the same. In fact, my data comes from GPW v3 ( http://sedac.ciesin.columbia.edu/gpw/global.jsp) but I didn't find any clue on the projection used, I suppose there is none as you say. When you speak about translating ground units, do you mean I have to translate my shapefile from degrees to, say, kilometers before I can use SIZEUNITS kilometers ? I thought it could be done dynamically by MapServer. I found a tutorial about this, I will try it anyway (assuming my data is WGS84) and give you the outcome :) I attached my mapfile this time, just in case I made a noob mistake somewhere... thank you very much ! Faldor 2008/5/28 Fawcett, David [EMAIL PROTECTED]: Faldor, When you have point coordinates stored in a text file, there really is no way to encode/attach the projection definition. Even if you could, it doesn't sound like you really know what spatial reference system (SRS) or projection that it is in. The key to projecting to another SRS or translating ground units to another measure (from degrees to meters) is knowing what the current SRS of the data is. Since your data is worldwide and it is unprojected (lat/lon), a good first guess would be to assume that it is unprojected with using the WGS84. Try defining your layer projection by including this block in your layer definition. PROJECTION init=epsg:4326 END David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pierre-Benoit Besse Sent: Wednesday, May 28, 2008 4:11 AM To: Fawcett, David Cc: mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Well, I confess, I'm new to GIS applications and I do not know a lot about projections. I understand I have to tell MapServer what is the projection of each layer I use in the mapfile, but using ogrinfo on my shapefiles tells me that : Layer name: pop_density Geometry: Point Feature Count: 249937 Extent: (-180.00, -56.00) - (179.75, 83.50) Layer SRS WKT: (unknown) latitude: Real (24.15) longitude: Real (24.15) densite: Real (24.15) I generated this shapefile from a CSV file with 3 columns : latitude, longitude, density_value. Did I have to define a projection then ? How do I do that ? Best regards, Faldor 2008/5/27 Fawcett, David [EMAIL PROTECTED]: Have you defined an output projection for your map and input projections for each of your layers? It is likely that MapServer needs to know what the input projection/SRS is before it can translate to different units. David. -Original Message- From: Pierre-Benoit Besse [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2008 11:26 AM To: Fawcett, David Cc: Ritesh Ambastha; mapserver-users@lists.osgeo.org Subject: Re: [MAPSERVER-USERS] Displaying population density with Mapserver Ha, well, I prefer that :) I would need a lot of layer definitions to obtain something ok... But I just tried the ground units stuff, I tried with a 50 kilometers wide square and it drew squares the size of ASIA !! oO I had to define a 1 feet wide square to obtain something more or less ok... Does anybody know why ? Aside from that It seems to work, thank you ! I will try the scalesymbol stuff tomorrow. Regards 2008/5/27 Fawcett, David [EMAIL PROTECTED]: Before you create lots of different layers to simulate symbol scaling, you may want to try something else. It has been a long time since I have played with scaled symbols, but give it a try. You should be able to scale the symbols by setting a SYMBOLSCALE in the LAYER object. This is the scale at which you want the symbol to appear at the SIZE stated in the map file. You may want to modify STYLE MAXSIZE if you think that you will want your symbols to be larger than 50 pixels. Another completely different approach that just came to my mind would be to use ground units (e.g. meters) to set the size of your symbol. To do this, set LAYER SIZEUNITS to meters. Calculate the size of a symbol in meters on
[mapserver-users] Mapserver 5 Joining
Hello List, I am busy migrating my application to mapserver 5. It's quite a task and I am running into some problems. I am working on fedora with the latest mapserver release from svn. My JOIN function (one to many) is not working. In the JOINED template the variables are not replaced with the values. Has the JOIN functionality changed with mapserver 5? Here is my layer: LAYER #Puntenthemalaag NAME Fotos GROUP group30 METADATA gix_layernameFoto's END DATA 'media/lokaties.shp' HEADER ../templates/media.htm FOOTER ../templates/media2.htm STATUS ON TOLERANCE 10 TEMPLATE '../q_nfotografie.html' TYPE POINT CLASS NAME fotos STYLE SYMBOL fototoestel SIZE 15 END END #CLASS JOIN NAME fotos TABLE media/fotos.dbf FROM LOKATIE TO LOK_ID TYPE one-to-many TEMPLATE '../q_fotografie2.html' END END # LAYER And here is my template option value=/geoviewer/watlas/fotos/middel/foto[fotos_FOTO].jpg;center[fotos_OM SCHRIJVI] br ([fotos_AUTEUR] - [fotos_DATE])center [fotos_OMSCHRIJVI] ([fotos_AUTEUR]) Best Regards, Wim Blanken The Netherlands ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Regular Expressions with PostGIS
Hi All We have an application that calls MapServer CGI from C# which creates regular expressions for qitem (itemnquery etc) - basically when calling a shape file all is good but not with PostGIS uniqueid~'(a|A)(b|B)(c|C)123' = good for postgis [uniqueid]=~/(a|A)(b|B)(c|C)123/ = bad for postgis (good for mapserver) Does anyone know a way around - the calling app doesn't necessarily know whether the base layer is PostGIS or OGR or Shape etc Cheers Mike ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Retrieve column names from getFeature ...
Hi, You can use layerObj.getItem() for this purpose. Best regards, Tamas 2008/5/29 Paul james [EMAIL PROTECTED]: Hello all... I have this code in mapscript (c#): ... resultCacheMemberObj _result = _layer.getResult(i); _layer.open(); shapeObj _obj = _layer.getFeature(_result.shapeindex, _result.tileindex); _layer.close(); ... So, in my _obj.values I have a array with db data... Is it posible to get the column name ? thanks ___ 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] Regular Expressions with PostGIS
Hilarity ensues, same issue being debated in another thread. In your case, no, there's probably no way around it. query is implemented as a FILTER, and filter gets passed directly to the underlying data store as SQL. The syntax for FILTER in shape files is mapserver specific, the syntax for PostGIS filter is PostgreSQL specific. Store all your data in postgis :) Or, more hackily, name your layers based on their storage type. pg_layer1, shp_layer2, etc. Sorry! P On Thu, May 29, 2008 at 9:24 AM, Mike Saunt [EMAIL PROTECTED] wrote: Hi All We have an application that calls MapServer CGI from C# which creates regular expressions for qitem (itemnquery etc) - basically when calling a shape file all is good but not with PostGIS uniqueid~'(a|A)(b|B)(c|C)123' = good for postgis [uniqueid]=~/(a|A)(b|B)(c|C)123/ = bad for postgis (good for mapserver) Does anyone know a way around - the calling app doesn't necessarily know whether the base layer is PostGIS or OGR or Shape etc Cheers Mike ___ 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] queryByAttributes on PostGIS-Layer
Paul Ramsey wrote: That makes some sense... but since the queryByAttribute code is based on key/value combos, it could present a uniform API, even if it implemented it different under the covers for shape/postgis. That would actually reduce the functionality compared to right now, though, since right now you can put any SQL filter you want into the API for PostGIS. You'd lose with shapefiles as well since you can pass logical and regex expressions for shapefiles and they should work. The API gives the impression that it's a key, value combo, but I think it's a doc issue, it's really a filteritem/filter combo unless I'm mistaken. I'd like to hear Steve's opinion on this one. Daniel -- Daniel Morissette http://www.mapgears.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Regular Expressions with PostGIS
Thanks Paul - I'll have to create a switch to identify... Thanks for the prompt response... 2008/5/29 Paul Ramsey [EMAIL PROTECTED]: Hilarity ensues, same issue being debated in another thread. In your case, no, there's probably no way around it. query is implemented as a FILTER, and filter gets passed directly to the underlying data store as SQL. The syntax for FILTER in shape files is mapserver specific, the syntax for PostGIS filter is PostgreSQL specific. Store all your data in postgis :) Or, more hackily, name your layers based on their storage type. pg_layer1, shp_layer2, etc. Sorry! P On Thu, May 29, 2008 at 9:24 AM, Mike Saunt [EMAIL PROTECTED] wrote: Hi All We have an application that calls MapServer CGI from C# which creates regular expressions for qitem (itemnquery etc) - basically when calling a shape file all is good but not with PostGIS uniqueid~'(a|A)(b|B)(c|C)123' = good for postgis [uniqueid]=~/(a|A)(b|B)(c|C)123/ = bad for postgis (good for mapserver) Does anyone know a way around - the calling app doesn't necessarily know whether the base layer is PostGIS or OGR or Shape etc Cheers Mike ___ 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] Problem with Label ...
Paul, hmmm, I'm sure I ran int this problem before, but I can not find any reference in my notes and I do not have access the oracle installation any more. I did a quick scan of all the oracle bugs and did not see it. maybe the problem I had was not oracle specific and was fixed, but might have been missed in the oracle branch of the code. I would write a bug up on it. -Steve Paul james wrote: Hello... Thank you for reply... I´m using version 5.0.2, compiled for C# + Oracle (MS4W Binary) There are some others layers with same mapfile definition, but without that bug.. Its very strange... []´s On 5/29/08, *Stephen Woodbridge* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi Paul, I believe this was a bug that has fixed. What version of mapserver are you using? -Steve W Paul james wrote: Hi Guys... Take a look in the attached image ... Why is mapserver putting white space after text? In the database is everthing ok, with no space at all... ps.: I added BACKGROUNDCOLOR to label to show up the problem... Using latest ms4w compiled version for C# + oracle... My Mapfile: LAYER #6 NAME BASE GROUP x TYPE POINT STATUS ON CONNECTIONTYPE oraclespatial CONNECTION x/y DATA GEOM from GEO_BASE USING UNIQUE ID VERSION 10G LABELITEM NAME CLASS TEMPLATE dummy NAME BASES STYLE SYMBOL circle MINSIZE 9 MAXSIZE 9 COLOR 255 255 13 OUTLINECOLOR 0 0 0 END LABEL BACKGROUNDCOLOR X X X COLOR X X X FONT arialTYPE TRUETYPE SIZE 10 ANTIALIAS TRUE POSITION AUTO PARTIALS FALSE BUFFER 3 END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org mailto: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] Problem with Label ...
Thanks Stephen ! I´ll waiting for news ! []´s On 5/29/08, Stephen Woodbridge [EMAIL PROTECTED] wrote: Paul, hmmm, I'm sure I ran int this problem before, but I can not find any reference in my notes and I do not have access the oracle installation any more. I did a quick scan of all the oracle bugs and did not see it. maybe the problem I had was not oracle specific and was fixed, but might have been missed in the oracle branch of the code. I would write a bug up on it. -Steve Paul james wrote: Hello... Thank you for reply... I´m using version 5.0.2, compiled for C# + Oracle (MS4W Binary) There are some others layers with same mapfile definition, but without that bug.. Its very strange... []´s On 5/29/08, *Stephen Woodbridge* [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: Hi Paul, I believe this was a bug that has fixed. What version of mapserver are you using? -Steve W Paul james wrote: Hi Guys... Take a look in the attached image ... Why is mapserver putting white space after text? In the database is everthing ok, with no space at all... ps.: I added BACKGROUNDCOLOR to label to show up the problem... Using latest ms4w compiled version for C# + oracle... My Mapfile: LAYER #6 NAME BASE GROUP x TYPE POINT STATUS ON CONNECTIONTYPE oraclespatial CONNECTION x/y DATA GEOM from GEO_BASE USING UNIQUE ID VERSION 10G LABELITEM NAME CLASS TEMPLATE dummy NAME BASES STYLE SYMBOL circle MINSIZE 9 MAXSIZE 9 COLOR 255 255 13 OUTLINECOLOR 0 0 0 END LABEL BACKGROUNDCOLOR X X X COLOR X X X FONT arialTYPE TRUETYPE SIZE 10 ANTIALIAS TRUE POSITION AUTO PARTIALS FALSE BUFFER 3 END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org mailto: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] International characters in text paramater
I think we need to refer to ANSI values, not ASCII. This works for me on both MS4W and a Linux version of Mapserver: TEXT Lowercase: #230;#248;#229; Uppercase: #198;#216;#197; Which should give something like this: http://bildr.no/view/205920 FrodeWJ 2008/5/29 Espen Isaksen [EMAIL PROTECTED]: Tried a bit more, and strange things happen. Sometimes Mapserver just runs for a long time without creating a map. Other times it creates a map, but the letters are totally wrong. When using 248 for ø I do not get any text at all. Using 156 for æ I get this: http://bildr.no/view/205560 Appreciate it if anybody knows why this happens. Espen 2008/5/29 Espen Isaksen [EMAIL PROTECTED]: Didn't get it to work as it should. This works: TEXT test This does not work(no text at all in the map): TEXT Lysl#248;ype If we do this TEXT (Lysl#248;ype) mapserver does not understand the ASCII value and prints it out exactly as typed. Espen 2008/5/28 Frode Wiseth Jørgensen [EMAIL PROTECTED]: Hi Espen Try this: TEXT Lysl#248;ype FrodeWJ 2008/5/28 Espen Isaksen [EMAIL PROTECTED]: Hi! Tried to find a answer to this but was unable to. I am trying to use Norwegian characters in the text parameter in the class object. I set Text (Lysløype) in the map file but this does not work. How can I do this correctly? Example follows: LAYER # Lysloype NAME Lysloype TYPE line STATUS default DATA bygg/lysloype MAXSCALE 2 TRANSPARENCY 80 LABELMAXSCALE 2000 CLASS STYLE COLOR 255 255 0 # Gul farge. SYMBOL point_line SIZE 4 END STYLE COLOR 255 255 0 # Gul farge. SYMBOL normal_line SIZE 1 END TEXT (Lysløpe) LABEL SIZE 7 COLOR 255 255 255 OUTLINECOLOR 100 100 100 ANGLE follow POSITION cc TYPE truetype FONT Verdana_bold MINDISTANCE 100 PARTIALS false END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Frode Wiseth Jørgensen +47 99 03 41 42 -- Frode Wiseth Jørgensen +47 99 03 41 42 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Error in running Map Server appliocation
Respt sir , i have written one hello map server simple programme in CGI , but when i click on button it will give Page could not found error. i m running this programme on windows i have also stop the IIS. i am sending my .htm .map file to you , so please help me ,its urgent . Thank you Title: MapServer Hello World hello.map Description: Binary data ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users