[mapserver-users] WFS on a view from a spatialite source
Rahkonen Jukka
jukka.rahkonen at mmmtike.fi
Sat Apr 13 08:47:40 PDT 2013
Hi,
I made some trials too. I used two different Windows binaries
- MS4W with gdal18.dll (2011-08-12) and Mapserver 6.0.1
- binaries from gisinternals including gdal110dev.dll (2013-03-24) and Mapserver 6.3dev
Spatialite database was of version 3.0 and created with Spatialite-gui 1.5.0
When I used MS4W with gdal18.dll I could use Spatialite layers in two ways:
CONNECTIONTYPE OGR
CONNECTION "test.sqlite"
DATA "layer"
or with
DATA "select GEOMETRY from layer"
View did not work. Error was:
msOGRFileOpen(): OGR error. GetLayer(layer_view) failed for OGR connection `test.sqlite'.
With the gdal110dev.dll thing were not better but worse. Only thing which worked was to use DATA "layer". If I used SELECT in the DATA definitions I got
msOGRFileNextShape(): OGR error. Unable to query table layer(GEOMETRY) for column definitions : no such table: layer(GEOMETRY).
View did not work with gdaldev110.dll and the error was again the same "no such table: layer(GEOMETRY)".
Ogrinfo using this same gdaldev110 version has no troubles in seeing the view as a layer in sqlite database, and is can also read data from the view. It looks like the problem is not in the GDAL but in the way Mapserver is using GDAL.
Could you repeat the test with "DATA "SELECT something FROM layer"?. My test suggests that even that does not work with Mapserver 6.3dev at the moment.
-Jukka Rahkonen-
________________________________
Andrea Peri wrote
> Hi,
> googling I found this thread:
> http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028373.html<http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028373.html>
> as reported in it seem that to see the spatialite view need to set the
> SQLITE_LIST_ALL_TABLES
> parameter.
> Is this kind of sqlite/spatialite parameters settable for an ogr connection inside a mafile ?
> Thx
2013/4/13 Andrea Peri <aperi2007 at gmail.com<mailto:aperi2007 at gmail.com>>
Hi,
thx for reply.
I check your hint.
As readable from spatialite documentation a spatial view seem need to registered on a special geometry column named:
views_geometry_columns
I add the view to this table but still the wfs seem don't understand any.
This is what it return:
<wfs:FeatureCollection
xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://www502.regione.toscana.it/cartografia/wmsraster/com.rt.wms.RTmap/wms?map=wmstest&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=v_lista_comuni_ordered_prov_com&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
<gml:Null>missing</gml:Null>
</gml:boundedBy>
</wfs:FeatureCollection>
2013/4/13 <pcreso at pcreso.com<mailto:pcreso at pcreso.com>>
Hi Andrea,
I'm not a spatialite user (more Postgis), but you may need to create an entry in the geometry_columns table that describes the view for mapserver to be able to access it.
Brent Wood
--- On Sat, 4/13/13, aperi2007 <aperi2007 at gmail.com<mailto:aperi2007 at gmail.com>> wrote:
From: aperi2007 <aperi2007 at gmail.com<mailto:aperi2007 at gmail.com>>
Subject: [mapserver-users] WFS on a view from a spatialite source
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Date: Saturday, April 13, 2013, 11:17 AM
Hi,
I'm try-ing to start a wfs service using a spatialite db as datasosurce.
It work if I use a table.
But using a spatial view it don't seem work
It return a GML Bound NULL.
I don't know if I'm wrong to set it.
There is any on that as successfully use a spatial view of spatialite as datasource for wfs ?
Thx,
Andrea Peri
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<http://mc/compose?to=mapserver-users@lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users
--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
More information about the MapServer-users
mailing list