[mapserver-users] Contents of mapserver-users digest
- Original Message From: mapserver-users-requ...@lists.osgeo.org mapserver-users-requ...@lists.osgeo.org To: mapserver-users@lists.osgeo.org Sent: Wed, January 20, 2010 12:45:25 PM Subject: mapserver-users Digest, Vol 24, Issue 63 Send mapserver-users mailing list submissions to mapserver-users@lists.osgeo.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/mapserver-users or, via email, send a message with subject or body 'help' to mapserver-users-requ...@lists.osgeo.org You can reach the person managing the list at mapserver-users-ow...@lists.osgeo.org When replying, please edit your Subject line so it is more specific than Re: Contents of mapserver-users digest... Today's Topics: 1. RE: RE: Images returning blank (Fawcett, David (MPCA)) 2. RE: RE: Images returning blank (Kent Morrison) 3. Contents of mapserver-users digest (Muammar (Mario) Manzanares) -- Message: 1 Date: Wed, 20 Jan 2010 11:05:36 -0600 From: Fawcett, David (MPCA) david.fawc...@state.mn.us Subject: RE: [mapserver-users] RE: Images returning blank To: Kent Morrison kmorri...@advantrack.com, 'Rahkonen Jukka' jukka.rahko...@mmmtike.fi, mapserver-users@lists.osgeo.org mapserver-users@lists.osgeo.org Message-ID: d2c2a8ae8e016c42a974f644af21e13902f592b...@mnmail05.ead.state.mn.us Content-Type: text/plain; charset=iso-8859-1 If you were just trying to display the data in a simple map, you could go without the projection info and still see something if you only wanted to display that layer. Let's add a PROJECTION obj to your layer: Take a look at http://spatialreference.org/ref/esri/102740/. I am pretty sure that this is the spatial reference system (SRS) that your data is in. MapServer uses SRS definitions in Proj.4 format. Here is a link to this SRS in Proj.4: http://spatialreference.org/ref/esri/102740/proj4/ In your LAYER, add PROJECTION proj=lcc lat_1=28.38 lat_2=30.283334 lat_0=27.83 lon_0=-99 x_0=60.01 y_0=400 ellps=GRS80 datum=NAD83 to_meter=0.3048006096012192 no_defs END Does this work? David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Kent Morrison Sent: Wednesday, January 20, 2010 10:45 AM To: 'Rahkonen Jukka'; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] RE: Images returning blank Removing the PROJECTION from the trafficflow_2007 map results in the following error: Cannot set new SRS on a map that doesn't have any projection set. Please make sure your mapfile has a PROJECTION defined at the top level. So what I need to do is figure out how to setup the PROJECTION. Which I have no idea on. The .prj file that can with the shp file is: PROJCS[NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet, GEOGCS[GCS_North_American_1983, DATUM[D_North_American_1983, SPHEROID[GRS_1980,6378137.0,298.257222101]], PRIMEM[Greenwich,0.0], UNIT[Degree,0.0174532925199433]], PROJECTION[Lambert_Conformal_Conic], PARAMETER[False_Easting,1968500.0], PARAMETER[False_Northing,1312.], PARAMETER[Central_Meridian,-99.0], PARAMETER[Standard_Parallel_1,28.38], PARAMETER[Standard_Parallel_2,30.283334], PARAMETER[Latitude_Of_Origin,27.83], UNIT[Foot_US,0.3048006096012192]] So now I am trying to figure out PROJECTIONS... Any suggestions or sites with examples that will help me here would be greatly appreciated. Thanks Kent -Original Message- From: Rahkonen Jukka [mailto:jukka.rahko...@mmmtike.fi] Sent: Tuesday, January 19, 2010 4:25 PM To: Kent Morrison; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Images returning blank Hi, The non-working one is in some other projection than epsg:4326. You will get that layer visible by removing projection also from the MAP level and using the extents from ogrinfo, but in order to show both layers together you should know the correct projection for both datasets. If projection is given at map level it must suit the extents. Epsg:4326 and EXTENT 2460247.751004 232706.929725 2507483.898985 294550.472704 do not suit. -Jukka- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org puolesta: Kent Morrison Lähetetty: ke 20.1.2010 0:14 Vastaanottaja: 'Fawcett, David (MPCA)'; 'mapserver-users@lists.osgeo.org' Aihe: [mapserver-users] RE: Images returning blank I ran ogrinfo.exe on the non-working file. C:\ms4w\tools\gdal-ogrogrinfo.exe c:\mapserverdata\shapefiles\1\trafficflow_200 7.shp trafficflow_2007 -so INFO: Open of `c:\mapserverdata\shapefiles\1\trafficflow_2007.shp' using driver `ESRI Shapefile' successful. Layer name: trafficflow_2007 Geometry: Line String
[mapserver-users] Joins with MapScript
Hello, Using MapScript C#, is there a way to get to the Join object (does it exist at all)? I can see layerObj.numjoins, but not layerObj.getJoin(i) or something similar. Is there a way to retrieve values from a joined table? Best regards, Berend Veldkamp ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Class gridObj on java mapscript
Hello my friends Anybody knows how to use the class gridObj on Java mapscript ? I can´t find the similar in java thanks a lot Flávio Souza ___ Flávio Souza (021) 7629-4249 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] VRT / CSV data sources are not displayed in a layer
Stefan, I asked you about your MAP definition to do some tests. This is what I tried and it works: It seems that you have to consider the following: 1. The name of the CSV file has to be the same as the layer name (layer boden and file name boden.csv). 2. You have to add the SrcLayer tag into your VRT file like this: OGRVRTDataSource OGRVRTLayer name=boden SrcDataSourceboden.csv/SrcDataSource SrcLayerboden/SrcLayer GeometryTypewkbPoint/GeometryType GeometryField encoding=PointFromColumns x=x-utm y=y-utm/ /OGRVRTLayer /OGRVRTDataSource Try it ! Greetings from México IC Carlos Ruiz From: Stefan Schantz sscha...@bfs.de To: Carlos Ruiz boolean10...@yahoo.com Cc: mapserver-users@lists.osgeo.org Sent: Thu, January 21, 2010 1:31:43 AM Subject: Re: [mapserver-users] VRT / CSV data sources are not displayed in a layer Well, here is the MAP definition, but the same mapfile works with the Shapefile, which I have transformed from the CSV/VRT-files, so I think, that the mapfile shouldn't be the issue. Stefan - MAP NAME rodos_bgefirst STATUS ON EXTENT 458690.8459237 1746161.3670216 6216440.5477323 6216440.5477323 UNITS METERS DEBUG 5 CONFIG MS_ERRORFILE /data/tmp/ms_debug.log SYMBOLSET ../symbols/symbols.sym FONTSET ../fonts/fonts.list SHAPEPATH /daten/rasterkarten/ PROJECTION init=epsg:3035 END OUTPUTFORMAT NAME png DRIVER GD/PNG MIMETYPE image/png EXTENSION PNG IMAGEMODE PC256TRANSPARENT ON END WEB IMAGEPATH /data/tmp/ IMAGEURL http://10.162.18.107/tmp/; METADATA WMS_ACCESSCONSTRAINTSnone WMS_SRS EPSG:4326 EPSG:32632 EPSG:25832 EPSG:31466 EPSG:31467 EPSG:31468 EPSG:3035 WMS_ONLINERESOURCE http://10.162.18.107/cgi-bin/mapserv?map=/data/umn/bfs/map/rodos_bgefirst_ssh.map; WMS_TITLERODOS Prognose Karte interpoliert WMS_FEATURE_INFO_MIME_TYPEtext/html WMS_ABSTRACTRODOS Prognose Karte END END INCLUDE ../include/legend_rodos.map --- Carlos Ruiz schrieb: Can you show me the MAP definition ? Maybe I can find something there IC Carlos Ruiz *From:* Stefan Schantz sscha...@bfs.de *To:* Carlos Ruiz boolean10...@yahoo.com *Cc:* mapserver-users@lists.osgeo.org *Sent:* Wed, January 20, 2010 12:01:40 PM *Subject:* Re: [mapserver-users] VRT / CSV data sources are not displayed in a layer Hello Carlos, my CSV-file ans VRT-file looks like your examples: My CSV is x-utm,y-utm,Wert 742226., 5374978., 0.00E+00 743422., 5375072., 0.00E+00 744620., 5375166., 0.00E+00 ... and my VTR is OGRVRTDataSource OGRVRTLayer name=boden SrcDataSource/daten/csv/boden.csv/SrcDataSource GeometryTypewkbPoint/GeometryType GeometryField encoding=PointFromColumns x=x-utm y=y-utm/ /OGRVRTLayer /OGRVRTDataSource and as I wrote, ogr2ogr could read my vrt/csv data and transform it into a shapefile.. Stefan Carlos Ruiz schrieb: Check that you have your CSV like this: Lat,Lng,House 48.1,0.25,My house 49.2,1.1,My girlfriend's house 47.5,0.75,My mother in law's house And that you have your VTR like this: OGRVRTDataSource OGRVRTLayer name=neighborhood SrcDataSource[FILE]/SrcDataSource GeometryTypewkbPoint/GeometryType LayerSRS[YOUR SRS]/LayerSRS GeometryField encoding=PointFromColumns x=Lng y=Lat/ /OGRVRTLayer /OGRVRTDataSource IC Carlos Ruiz *From:* Stefan Schantz sscha...@bfs.de mailto:sscha...@bfs.de *To:* mapserver-users@lists.osgeo.org mailto:mapserver-users@lists.osgeo.org *Sent:* Wed, January 20, 2010 9:32:12 AM *Subject:* [mapserver-users] VRT / CSV data sources are not displayed in a layer Hello List, The following layer uses a CSV-file (together with a VRT-File (Virtual Format) ) as datasource . When I try to visualize the layer, nothing is shown (neither the data nor error messages; shp2img shows also nothing) LAYER NAME boden DEBUG on STATUS ON TYPE POINT # DATA /daten/csv/boden/boden # Datenquelle Shapefile CONNECTION /daten/csv/boden.vrt CONNECTIONTYPE OGR PROJECTION init=epsg:25832 END METADATA WMS_TITLEtest WMS_SRS EPSG:25832 WMS_ABSTRACTtest WMS_FEATURE_INFO_MIME_TYPE 'text/html' END CLASS NAME test STYLE SYMBOL circle SIZE 15 COLOR 90 90 90 END END END But if I transform the CSV/VRT-file into a Shapefile via ogr2ogr ogr2ogr -s_srs EPSG:25832 -t_srs EPSG:25832 -f ESRI Shapefile boden boden.vrt the layer displays the data. What is wrong with my VRT/CSV-datasource
[mapserver-users] Re: Mapserver tutorial
Sajjad Anwar wrote: Hello Jeff. I was reading through the Mapserver.org website and found your tutorial. The material is very helpful. But the download link is broken. Can you send me an offline pdf version of it? Thanks! Hello Sajjad, You should now be able to download the MapServer documentation from the Downloads page, in PDF format (http://www.mapserver.org/download.html#documentation) -jeff -- Jeff McKenna FOSS4G Consulting and Training Services http://www.gatewaygeomatics.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Field type
Hi, Is there a way to determine field types of a layer (string, number, ...), using mapscript? Thanks, Berend - Berend Veldkamp http://www.grontmij.com http://www.grontmij.com -- View this message in context: http://n2.nabble.com/Field-type-tp4435623p4435623.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] Field type
Berend, The fields are represented as strings in MapServer so the field types cannot normally be obtained in MapScript. In case of a shapefile layer you could probably create a shapefileObj and use getDBF to obtain a DBInfo object and use DBInfo.getFieldType to retrieve the type of a specific field. However this option is not widely used and you might want to use the GDAL/OGR bindings instead. Best regards, Tamas 2010/1/21 Berend b.veldk...@zonnet.nl Hi, Is there a way to determine field types of a layer (string, number, ...), using mapscript? Thanks, Berend - Berend Veldkamp http://www.grontmij.com http://www.grontmij.com -- View this message in context: http://n2.nabble.com/Field-type-tp4435623p4435623.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] Joins with MapScript
Berend, This functionality is not yet exposed in the MapScript interface, you can specify the JOIN elements in your mapfile though. Best regards, Tamas 2010/1/21 Berend Veldkamp b.veldk...@zonnet.nl Hello, Using MapScript C#, is there a way to get to the Join object (does it exist at all)? I can see layerObj.numjoins, but not layerObj.getJoin(i) or something similar. Is there a way to retrieve values from a joined table? Best regards, Berend Veldkamp ___ 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] Class gridObj on java mapscript
Flavio, I'm not aware of such class exposed in Java MapScript. Best regards, Tamas 2010/1/21 Flavio Souza fls...@gmail.com Hello my friends Anybody knows how to use the class gridObj on Java mapscript ? I can´t find the similar in java thanks a lot Flávio Souza ___ Flávio Souza (021) 7629-4249 ___ 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] VRT / CSV data sources are not displayed in a layer
Stefan, I would suspect that your .vrt file contains relative rather than absolute paths and that they are relative to a different working directory if used from MapServer. There is an attribute for the SrcDataSource that may address this. It might help if you posted the VRT. 2010/1/20 Stefan Schantz sscha...@bfs.de: Hello List, The following layer uses a CSV-file (together with a VRT-File (Virtual Format) ) as datasource . When I try to visualize the layer, nothing is shown (neither the data nor error messages; shp2img shows also nothing) LAYER NAME boden DEBUG on STATUS ON TYPE POINT # DATA /daten/csv/boden/boden # Datenquelle Shapefile CONNECTION /daten/csv/boden.vrt CONNECTIONTYPE OGR PROJECTION init=epsg:25832 END METADATA WMS_TITLE test WMS_SRS EPSG:25832 WMS_ABSTRACT test WMS_FEATURE_INFO_MIME_TYPE 'text/html' END CLASS NAME test STYLE SYMBOL circle SIZE 15 COLOR 90 90 90 END END END But if I transform the CSV/VRT-file into a Shapefile via ogr2ogr ogr2ogr -s_srs EPSG:25832 -t_srs EPSG:25832 -f ESRI Shapefile boden boden.vrt the layer displays the data. What is wrong with my VRT/CSV-datasource in the mapfile? Thanks for any idea. Best regards Stefan ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] PHP layer-updateFromString problem setting type and symbol name
I really like the updateFromString functions in Mapserver Mapscript. I've eliminated my .map files, instead storing the layer definitions in a database and drawing them on-demand using PHP. However, I've found a few values ($layer-type and $style-symbolname) that aren't correctly set using Mapserver 5.6.1 (also tried 5.4.2). Here's an example: ?php $mapDef=MAP NAME 'test' SIZE 400 400 EXTENT 0 0 100 100 END ; $layerDef=LAYER NAME 'Airports' STATUS ON TYPE point FEATURE POINTS 10 10 50 50 1 50 70 10 END END CLASS STYLE SYMBOL 'airport.gif' END END END; $oMap = ms_newMapObjFromString($mapDef); $oLayer=ms_newLayerObj($oMap); $oLayer-updateFromString($layerDef); //First problem: returns -1 //echo $oLayer-type; //$oLayer-set(type,MS_LAYER_POINT); //Second problem is that the symbol gif isn't used //unless it is explicitly set again below //$cls = $oLayer-getClass(0); //$style = $cls-getStyle(0); //if($style-symbolname!='')$style-set(symbolname,$style-symbolname); $oMap-selectOutputFormat('gif'); $img = $oMap-draw(); $img-saveImage(output.gif); ? ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] SQL Server 2008 layer C# MapScript query help
Hi, I'm just starting out with MapServer / MapScript C#. I get Attempted to read or write protected memory when trying to retrieve the shape of the selection in a SQL Server layer. Code snippet below (adapted from example code): if (layer.queryByPoint(Map, point, mapscript.MS_SINGLE, tolerance) == (int)MS_RETURN_VALUE.MS_SUCCESS) { resultCacheObj result = layer.getResults(); if (result.numresults 0) { int shapeInd = result.getResult(0).shapeindex; layer.open(); shapeObj shape = layer.getFeature(shapeInd, -1); --Attempted to read or write protected memory string txt = ; for (int i = 0; i shape.numvalues;i++)// layer.numitems; i++) { txt += b+ layer.getItem(i) +: /b; txt += + shape.getValue(i) + br/; } etc. Additional notes: * the tolerance 0 * IIS 5 * using latest build (MSVC2008 (Win32) -stable release-1500-gdal-1-6-mapserver-5-6.zip) DLLs (including msplugin_mssql2008.dll) * VS 2008 project * the SQL Server layer geometry is points draws without problems * code works for other layers in may map Additional issue: When doing a queryByShape on the SQL Server layer and try drawQuery on the map I get Image handling error. Failed to draw layer... Am doing something wrong - is this the correct way of going about querying visualizing? Is what I trying to do possible with SQL Server layers? Any help/pointers appreciated. Thanks Will ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users