[mapserver-users] Re: ODBC OGR MS SQL CONNECTION
Hi all, This now works, I've used * instead of listing columns.. SELECT * FROM MOBILEUNIT INNER JOIN MUGPSDATALOG ON MOBILEUNIT.MUID=MUGPSDATALOG.MUID WHERE MUGPSDATALOG.EVENTLOGID IN(SELECT MAX(EVENTLOGID) FROM MUFLEET INNER JOIN MUGROUP ON MUFLEET.FLEETID = MUGROUP.FLEETID INNER JOIN MOBILEUNIT ON MUGROUP.GROUPID = MOBILEUNIT.GROUPID INNER JOIN MUGPSDATALOG ON MOBILEUNIT.MUID=MUGPSDATALOG.MUID where MUFLEET.FLEETID=37144 group by MOBILEUNIT.MUID) ORDER BY MOBILEUNIT.PLATE And I'll try for ogr performance suggestions... Regards.. -- View this message in context: http://n2.nabble.com/ODBC-OGR-MS-SQL-CONNECTION-tp4824960p4829220.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] Re: ODBC OGR MS SQL CONNECTION
I've changed like this CONNECTION " ODBC:webuser/webu...@mssql,AracView SELECT * FROM AracView wkbPoint " And result; msDrawMap(): Image handling error. Failed to draw layer named 'Araclar'. msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `Araclar'. Parse error at EOF, not all elements have been closed, starting with SrcDataSource Is there a problem while using comma? -- View this message in context: http://n2.nabble.com/ODBC-OGR-MS-SQL-CONNECTION-tp4824960p4829293.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] Re: ODBC OGR MS SQL CONNECTION
Hi all, Everything is ok now.. Works and fast enough.. Best Regards.. -- View this message in context: http://n2.nabble.com/ODBC-OGR-MS-SQL-CONNECTION-tp4824960p4829341.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] Re: ODBC OGR MS SQL CONNECTION
ibrahimsaricicek wrote: I've changed like this CONNECTION " ODBC:webuser/webu...@mssql,AracView SELECT * FROM AracView wkbPoint " And result; msDrawMap(): Image handling error. Failed to draw layer named 'Araclar'. msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `Araclar'. Parse error at EOF, not all elements have been closed, starting with SrcDataSource Is there a problem while using comma? Ibrahim, I vaguely recall that if you do not include a DATA statement declaring the layer you want to operate from OGR, then the connection string is parsed using a comma to identify the layer. So try your existing connection string, but add: DATA "Araclar" and see if that helps. Best regards, -- ---+-- 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
Re: [mapserver-users] Re: ODBC OGR MS SQL CONNECTION
Hi Frank I have an OpenLayers / Mapserver system, where some of the data comes from a SQL-Server database via OGR. Trying to understand where a FILTER condition is applied. Here is a snippet from my Mapfile: LAYER # name of layer NAME "apiariestm" TYPE POINT UNITS METERS # actual data pointer CONNECTION "./apiariestm.ovf" CONNECTIONTYPE OGR DATA "apiariestm" FILTER "WHERE apiary_id = '%apiaryid%'" STATUS ON Here is the OGR .ovf file: ODBC:user/pas...@apiary vw_ogr_apiary_layer wkbPoint EPSG:2193 apiary_id The SrcLayer is a view. Does the filter get applied at the Mapserver end, i.e. all the points in the map window get retrieved, and then the filter is applied, or does Mapserver send the filter through to OGR? Many thanks, Robert Sanson This message has been scanned for malware by SurfControl plc. www.surfcontrol.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: ODBC OGR MS SQL CONNECTION
Robert Sanson wrote: Hi Frank I have an OpenLayers / Mapserver system, where some of the data comes from a SQL-Server database via OGR. Trying to understand where a FILTER condition is applied. Here is a snippet from my Mapfile: LAYER # name of layer NAME "apiariestm" TYPE POINT UNITS METERS # actual data pointer CONNECTION "./apiariestm.ovf" CONNECTIONTYPE OGR DATA "apiariestm" FILTER "WHERE apiary_id = '%apiaryid%'" STATUS ON Here is the OGR .ovf file: ODBC:user/pas...@apiary vw_ogr_apiary_layer wkbPoint EPSG:2193 apiary_id The SrcLayer is a view. Does the filter get applied at the Mapserver end, i.e. all the points in the map window get retrieved, and then the filter is applied, or does Mapserver send the filter through to OGR? Robert, A few (1-4) years ago we modified the OGR connection type to push the filter into OGR if the filter starts with "WHERE ". So in your case it should get pushed all the way through to SQL Server which is where you would want it. If you can run your map via "shp2img" you could do the following: set CPL_DEBUG=ON shp2img -m yourmap -o out.png and you should see a bunch GDAL/OGR debug output in the terminal, including (hopefully) the actual SQL statement issued against SQL Server. Best regards, -- ---+-- 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