[mapserver-users] OGR VRT and mysql - Unable to identify source...
Hi, Sorry about crossposting, I posted this in MapFish users list but I realised that here is the correct place. Sorry also my bad english. I'm learning OGR VRT and mysql, but can't undestand why this error occurs: my html: .. var basemap = new OpenLayers.Layer.MapServer("Anhumas", "http://localhost:8080/cgi-bin/mapserv.exe?";, {map: 'G:/UsbWebserver/Root/mydata/config/Tremembe/tremembe-mysql.map', layers: ['lotes', 'reserva', 'labels'], format: 'png', transparent: 'off', maxExtent: new OpenLayers.Bounds(-51.543783, -22.985484, -51.508519, -22.936574) ,mode: 'map' }, {singleTile: true} ); map.addLayer(basemap); map.setCenter(new OpenLayers.LonLat(-51.52669, -22.95777), 13.45); map.addControl(new OpenLayers.Control.MousePosition()); } .. my map: . LAYER NAME "lotes" CONNECTIONTYPE OGR CONNECTION "G:/UsbWebserver/Root/mydata/config/Tremembe/lotes.ovf" TYPE polygon STATUS ON DATA "lotes" METADATA .. my ovl: MYSQL:assentamento,user=root,tables=tremembe_lotes SELECT * FROM tremembe_lotes wkbUnknown my orginfo: G:\UsbWebserver\tools\gdal-ogr>ogrinfo MySQL:assentamento,user=root tremembe_lotes -so INFO: Open of `MySQL:assentamento,user=root' using driver `MySQL' successful. Layer name: tremembe_lotes Geometry: Polygon Feature Count: 102 Extent: (-51.543783, -22.985484) - (-51.508519, -22.936574) Layer SRS WKT: (unknown) FID Column = OGR_FID Geometry Column = lotcoords id: Real (10.0) num_lote: Real (10.0) nome_ass: String (40.0) The Firebug answer: MapServer Message msDrawMap(): Image handling error. Failed to draw layer named 'lotes'. msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `lotes'. Unable to identify source field 'lotcoords' for geometry. Can anyone please point me where to search for this error? Thanks in advance, aracandrade ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMSGetFeautureInfo
Hi Steve, The layer is already a global variable. But nevertherless I think I found the problem based on your remark. I have used the layer name of mapserver and not the javascript variable layer reference! Thanks!!! Stephen Woodbridge schreef: Hi Peter, Since I just struggle my through this exact example, I think I might be able to help :) Peter Huis in 't Veld wrote: Hi, I'm trying to set up a WMS service with the possibility to obtain a popup containing the feature items. the components I''m using is: - Openlayer - Mapserver Testing it I can visualize all items but I get the following error message : Message: Object doesn't support this property or method Line: 229 Char: 9 Code: 0 URI: http://myserver/lib/OpenLayers/Handler/Feature.js Looking at the code it looks like it has something to with the evalaution of the mouse click event I've three questions: - Could someone explain a bit more about this error? - Should I stick with WMS or should I use WFS? - Does someone has some advice what might cause a problem based on the code snippet underneath? Thanks in advance for any support Peter Within in my webpage I've some javascript looking like: The problem is that you need to declare you layer as a global: var test; function init() { test = = new OpenLayers.Layer.WMS( ... ); info = { click: new OpenLayers.Control.WMSGetFeatureInfo({ 'url': 'http://', 'title': 'Identify features by clicking', then change the next line to be: 'layers': [test], 'layers': "test", I think that might fix things up for you. -Steve W 'queryVisible': true })}; for (var i in info) { info[i].events.register("getfeatureinfo", this, showInfo); map.addControl(info[i]); } info.click.activate(); } function showInfo(evt) { if (evt.features && evt.features.length) { highlightLayer.destroyFeatures(); highlightLayer.addFeatures(evt.features); highlightLayer.redraw(); } else { $('responseText').innerHTML = evt.text; } } In mapserver I've defined the layer and all wms_... parameters LAYER METADATA "wms_title" "IVS90 Stremmingen" "wms_include_items" "all" "wms_feature_info_mime_type" "text/html" END TYPE POINT TOLERANCE 10 TOLERANCEUNITS kilometers ... CLASS TEMPLATE "template.html" ... 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
[mapserver-users] WMSGetFeatureInfo
Hi, I'm trying to set up a WMS service with the possibility to obtain a popup containing the feature items. the components I''m using is: - Openlayer - Mapserver Testing it I can visualize all items but I get the following error message : Message: Object doesn't support this property or method Line: 229 Char: 9 Code: 0 URI: http://myserver/lib/OpenLayers/Handler/Feature.js Looking at the code it looks like it has something to with the evalaution of the mouse click event I've three questions: - Could someone explain a bit more about this error? - Should I stick with WMS or should I use WFS? - Does someone has some advice what might cause a problem based on the code snippet underneath? Thanks in advance for any support Peter Within in my webpage I've some javascript looking like: function init() { info = { click: new OpenLayers.Control.WMSGetFeatureInfo({ 'url': 'http://', 'title': 'Identify features by clicking', 'layers': "test", 'queryVisible': true })}; for (var i in info) { info[i].events.register("getfeatureinfo", this, showInfo); map.addControl(info[i]); } info.click.activate(); } function showInfo(evt) { if (evt.features && evt.features.length) { highlightLayer.destroyFeatures(); highlightLayer.addFeatures(evt.features); highlightLayer.redraw(); } else { $('responseText').innerHTML = evt.text; } } In mapserver I've defined the layer and all wms_... parameters LAYER METADATA "wms_title" "IVS90 Stremmingen" "wms_include_items" "all" "wms_feature_info_mime_type" "text/html" END TYPE POINT TOLERANCE 10 TOLERANCEUNITS kilometers ... CLASS TEMPLATE "template.html" ... END END <>___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMSGetFeautureInfo
Hi Peter, Since I just struggle my through this exact example, I think I might be able to help :) Peter Huis in 't Veld wrote: Hi, I'm trying to set up a WMS service with the possibility to obtain a popup containing the feature items. the components I''m using is: - Openlayer - Mapserver Testing it I can visualize all items but I get the following error message : Message: Object doesn't support this property or method Line: 229 Char: 9 Code: 0 URI: http://myserver/lib/OpenLayers/Handler/Feature.js Looking at the code it looks like it has something to with the evalaution of the mouse click event I've three questions: - Could someone explain a bit more about this error? - Should I stick with WMS or should I use WFS? - Does someone has some advice what might cause a problem based on the code snippet underneath? Thanks in advance for any support Peter Within in my webpage I've some javascript looking like: The problem is that you need to declare you layer as a global: var test; function init() { test = = new OpenLayers.Layer.WMS( ... ); info = { click: new OpenLayers.Control.WMSGetFeatureInfo({ 'url': 'http://', 'title': 'Identify features by clicking', then change the next line to be: 'layers': [test], 'layers': "test", I think that might fix things up for you. -Steve W 'queryVisible': true })}; for (var i in info) { info[i].events.register("getfeatureinfo", this, showInfo); map.addControl(info[i]); } info.click.activate(); } function showInfo(evt) { if (evt.features && evt.features.length) { highlightLayer.destroyFeatures(); highlightLayer.addFeatures(evt.features); highlightLayer.redraw(); } else { $('responseText').innerHTML = evt.text; } } In mapserver I've defined the layer and all wms_... parameters LAYER METADATA "wms_title" "IVS90 Stremmingen" "wms_include_items" "all" "wms_feature_info_mime_type" "text/html" END TYPE POINT TOLERANCE 10 TOLERANCEUNITS kilometers ... CLASS TEMPLATE "template.html" ... 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
[mapserver-users] WMSGetFeautureInfo
Hi, I'm trying to set up a WMS service with the possibility to obtain a popup containing the feature items. the components I''m using is: - Openlayer - Mapserver Testing it I can visualize all items but I get the following error message : Message: Object doesn't support this property or method Line: 229 Char: 9 Code: 0 URI: http://myserver/lib/OpenLayers/Handler/Feature.js Looking at the code it looks like it has something to with the evalaution of the mouse click event I've three questions: - Could someone explain a bit more about this error? - Should I stick with WMS or should I use WFS? - Does someone has some advice what might cause a problem based on the code snippet underneath? Thanks in advance for any support Peter Within in my webpage I've some javascript looking like: function init() { info = { click: new OpenLayers.Control.WMSGetFeatureInfo({ 'url': 'http://', 'title': 'Identify features by clicking', 'layers': "test", 'queryVisible': true })}; for (var i in info) { info[i].events.register("getfeatureinfo", this, showInfo); map.addControl(info[i]); } info.click.activate(); } function showInfo(evt) { if (evt.features && evt.features.length) { highlightLayer.destroyFeatures(); highlightLayer.addFeatures(evt.features); highlightLayer.redraw(); } else { $('responseText').innerHTML = evt.text; } } In mapserver I've defined the layer and all wms_... parameters LAYER METADATA "wms_title" "IVS90 Stremmingen" "wms_include_items" "all" "wms_feature_info_mime_type" "text/html" END TYPE POINT TOLERANCE 10 TOLERANCEUNITS kilometers ... CLASS TEMPLATE "template.html" ... END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] itemfeaturequery & qstring
Hi all, I apologize in advance for maybe supplying too much detail. I have highlighted my questions to try to make this post faster to look through. I am using mode=itemfeaturequery to locate a polygon by column 'objectid' in 'slayer=parcels', then searching 'qlayer=parcels_01' which is identical to layer 'parcels' to find all of the parcels within TOLERANCE 500, TOLERANCEUNITS FEET. Questions here and then in context: 1: Why doesn't changing the TOLERANCE in layer 'parcels_01' change the number of parcels returned? 2: What is the difference between my scenario and the Test Suite? Besides attempting to use TOLERANCE > 0? And the use of FILTER? And the Test Suite layer being a shapefile and mine being a spatial DB? :-) CGI control 'qstring' appears to pass a string to be used in the WHERE clause of the SQL query correct? As always, many, many thanks in advance, Ted S. I have encountered two obstacles: 1. My understanding of TOLERANCE and TOLERANCEUNITS - The returned results are not as expected. Using units FEET, the returned/mapped records are identical as long as the value of TOLERANCE is > 0. Here is the url query: http://url.com/cgi-bin/mapserv? qstring=objectid+%3D+1019608 (qstring=objectid = 1019608) ** this is the subject of 2nd question &map=/path/to/cad.map &mode=itemfeaturequery &slayer=parcels &qitem=objectid &qlayer=parcels_01 &qformat=selected_parcel &mapext=shape &layers=all Here are map and layer definitions for 'parcels' and 'parcels_01' MAP NAME "CAD" SIZE800 800 EXTENT -125 24 -65 50 UNITS DD # modifying map units changes the number of records returned IMAGECOLOR100 100 255 PROJECTION "init=epsg:4326" END QUERYMAP STATUS ON STYLE hilite COLOR 212 212 212 END OUTPUTFORMAT NAME 'selected_parcel' DRIVER 'TEMPLATE' MIMETYPE 'text/html' FORMATOPTION 'FILE=selected_parcel.tmpl' END SCALEBAR STATUS embed INTERVALS 5 ALIGN left POSITION lr SIZE 600 8 UNITS feet COLOR 0 0 0 BACKGROUNDCOLOR 212 212 212 END # End Scalebar LAYER NAME 'parcels' TYPE POLYGON STATUS DEFAULT DEBUG 3 TEMPLATE'dummy' DUMP TRUE MAXSCALEDENOM 7000 CONNECTIONTYPE POSTGIS CONNECTION "dbname=cad1 user=user password=pw host=localhost port=5432" DATA"the_geom from parcels using unique gid using srid=-1" LABELITEM "owner_name" PROCESSING 'LABEL_NO_CLIP=1' #TOLERANCEUNITS feet (these two parameters appear to not have any effect in this layer) #TOLERANCE 500 CLASS STYLE WIDTH 1 OUTLINECOLOR 0 255 0 END LABEL COLOR 0 0 0 TYPE TRUETYPE FONT ARIAL SIZE 10 BUFFER 5 MINFEATURESIZE 20 POSITION AUTO ANGLE AUTO END END # End class PROJECTION "init=epsg:2278" END METADATA "wms_title" "County Property Parcels" "wfs_title" "County Property Parcels" "wms_srs" "epsg:2278" "gml_include_items" "all" "gml_featureid" "ogc_fid" ## REQUIRED "qstring_validation_pattern" '.' END END # End layer 'parcels' LAYER NAME 'parcels_01' TYPE POLYGON STATUS ON DEBUG 3 TEMPLATE'dummy' DUMP TRUE MAXSCALEDENOM 7000 CONNECTIONTYPE POSTGIS CONNECTION "dbname=cad1 user=user password=pw host=localhost port=5432" DATA"the_geom from parcels using unique gid using srid=-1" LABELITEM "owner_name" PROCESSING 'LABEL_NO_CLIP=1' TOLERANCEUNITS feet TOLERANCE 1500 # The same records are returned whether this is 500 or 1500 CLASS STYLE WIDTH 2 COLOR 139 136 120 OUTLINECOLOR 212 212 212 END LABEL COLOR 0 0 0 TYPE TRUETYPE FONT ARIAL SIZE 10 MINFEATURESIZE 20 POSITION AUTO ANGLE AUTO END END # End class PROJECTION "init=epsg:2278" END METADATA "wms_title" "County Property Parcels Comparison Layer" "wfs_title" "County Property Parcels Comparison Layer" "wms_srs" "epsg:2278" "gml_include_items" "all" "gml_featureid" "ogc_fid" ## REQUIRED "qstring_validation_pattern" '.' END END # End layer 'parcels_01' *** To summarize question 1: Why doesn't changing the TOLERANCE in layer 'parcels_01' change the number of parcels returned? *** 2. My understanding of qstring - My qstring and related qitem in the above url is: qstring=objectid+%3D+1019608 (qstring=objectid = 1019608) &qitem=objectid My intuition is that it should be 'qstring=1019608' and 'qitem=objectid' - by looking at the test suit
Re: [mapserver-users] WMS GetFeatureInfo - how do I get the geometry?
Stephen Woodbridge wrote: I using a WMS GetFeatureInfo request that is returning GML and seems to be working except I need the geometry and all I'm getting is the bounding box of the the object. I have read through the "WMS Server" but I'm not seeing any clues there that might help. I ran into the same problem. See: http://trac.osgeo.org/mapserver/ticket/2989 http://trac.osgeo.org/mapserver/ticket/3161 http://mapserver.org/ogc/wfs_server.html -S ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMSGetFeatureInfo problems with OpenLayers
Hi, I would have a try by using absolute paths to templates. For me it is often hard to understand what is the starting point for relative paths. -Jukka Rahkonen- Stephen Woodbridge wrote: Hi all, I have been struggling with this problem all afternoon, so it is time to ask for some more help. I have made some progress with Daniel M. help on the OpenLayers list, but I'm not sure where the problem lies. The problem: I'm trying to replicates: http://dev.openlayers.org/releases/OpenLayers-2.8/examples/getfeatureinfo-control.html using mapserver instead of geoserver. When I click to query in my app the following request is generated by openlayers: http://example.com/cgi-bin/mapserv?map=/maps/test-900913-wms.map&&service=WMS&version=1.1.0&request=GetFeatureInfo&layers=Parcels&query_layers=Parcels&styles=&bbox=-10739792.365943%2C3773437.912618%2C-10739165.343461%2C3774064.9351&srs=EPSG%3A900913&feature_count=1&x=234&y=399&height=525&width=525&info_format=text%2Fhtml And I get this response: Content-type: application/vnd.ogc.se_xml http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd";> msReturnPage(): Web application error. Malformed template name (parcels.hdr). The templates are in the SHAPEPATH directory. The Layer looks like: LAYER NAME "Parcels" METADATA wms_title "Parcels" END TRANSPARENCY ALPHA STATUS ON CONNECTIONTYPE postgis CONNECTION "user= dbname=mytestdata host=localhost" DATA "the_geom from (select * from parcels) as foo using SRID=900913 using unique gid" TYPE POLYGON LABELITEM "parcel_id" MAXSCALEDENOM 4000 HEADER "parcels.hdr" TEMPLATE "parcels.tpl" FOOTER "parcels.ftr" DUMP TRUE PROJECTION "init=epsg:900913" END CLASS STYLE COLOR -1 -1 -1 WIDTH 2 OUTLINECOLOR 255 0 255 END LABEL TYPE TRUETYPE FONT "arial" SIZE 7 COLOR "#00" PARTIALS FALSE END END END Running: MapServer version 5.6.0-beta5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE Any ideas would be appreciated. -Steve W. ___ 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] WMS GetFeatureInfo - how do I get the geometry?
I using a WMS GetFeatureInfo request that is returning GML and seems to be working except I need the geometry and all I'm getting is the bounding box of the the object. I have read through the "WMS Server" but I'm not seeing any clues there that might help. Thanks, -Steve http://example.com/cgi-bin/mapserv?map=/maps/test-900913-wms.map&&service=WMS&version=1.1.0&request=GetFeatureInfo&layers=Parcels&query_layers=Parcels&styles=&bbox=-10739792.365943%2C3773437.912618%2C-10739165.343461%2C3774064.9351&srs=EPSG%3A900913&feature_count=10&x=236&y=462&height=525&width=525&info_format=application%2Fvnd.ogc.gml http://www.opengis.net/gml"; xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> -10739641.347221,3773434.931311 -10739364.637001,3773760.627503 LAYER defined like: LAYER NAME "Parcels" METADATA wms_title "Parcels" #gml_include_items "all" # tried with/without commented END TRANSPARENCY ALPHA STATUS ON CONNECTIONTYPE postgis CONNECTION "user= dbname=mytest_data host=localhost" DATA "the_geom from (select * from parcels) as foo using SRID=900913 using unique gid" TYPE POLYGON LABELITEM "parcel_id" MAXSCALEDENOM 4000 HEADER "/template/parcels_hdr.html" TEMPLATE "/template/parcels_tpl.html" FOOTER "/template/parcels_ftr.html" DUMP TRUE PROJECTION "init=epsg:900913" END CLASS STYLE COLOR -1 -1 -1 WIDTH 2 OUTLINECOLOR 255 0 255 END LABEL TYPE TRUETYPE FONT "arial" SIZE 7 COLOR "#00" PARTIALS FALSE END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users