[mapserver-users] Connection to SpatiaLite utilizing SQL

Rahkonen Jukka jukka.rahkonen at mmmtike.fi
Fri Feb 22 15:02:55 PST 2013


Hi,

I checked my mapfiles and I have been using
CONNECTIONTYPE OGR
CONNECTION "\ms4w\data\OSM_Suomi_20120213.sqlite"
PROCESSING "CLOSE_CONNECTION=DEFER"
DATA "select geometry, osm_id ,place , name from osm_point where place is not null"

Nothing so much different than what you have. The error you get looks a bit odd and suggests that Mapserver is trying to find a table called "Lines(geometry)".

I would make a blind try and copy the "Lines" table to another table with all underscore characters in the table name.

-Jukka Rahkonen-

________________________________
Roman wrote:

Hi list,
I have a working connection to SpatiaLite

  CONNECTION "c:/Temp/test.sqlite"
  DATA "Lines"

For certain layers I need to specify connection by SQL. According to http://mapserver.org/input/vector/sqlite.html I tried this:

  CONNECTION "c:/Temp/test.sqlite"
  DATA "SELECT geometry FROM Lines"

With 6.2.0 stable it does not render specified layer and does not throw any error.
With development version taken from http://www.gisinternals.com/sdk/ I get an error "msOGRFileNextShape(): OGR error. Unable to query table Lines(geometry) for column definitions : no such table: Lines(geometry)."

Geometry column is correctly registered in geometry_columns table and "ogrinfo test.sqlite Lines -summary" says "Geometry Column = geometry". Where could be the problem?

Thank you in advance.

Roman




More information about the MapServer-users mailing list