<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Jukka.<br><br>effectively the work of spatialite with mapserver is quite strange. :)<br><br></div><div>But thx to youe response I have resolved and it work. :)<br></div>
<br></div>Infact my original setting was exactly:<br><br>DATA 'select field1,field1,field3 from my_view'<br><br></div>I usually use this configuration because it is better for the GetFeatureInfo wms's requests.<br>
<br></div><div>And with this configuration the wfs seem don't work.<br><br></div><div>But if I change to this other configuration:<br></div><br></div>DATA 'my_view'<br><br></div>It work.<br><br></div><div>As you can see<br>
<a href="http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmstest&service=wfs&version=1.1.0&srsname=epsg:25832&request=GetFeature&typename=v_lista_comuni_ordered_prov_com&propertyName=nprov,ncom,codcom,codprov&sortBy=ncom">http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmstest&service=wfs&version=1.1.0&srsname=epsg:25832&request=GetFeature&typename=v_lista_comuni_ordered_prov_com&propertyName=nprov,ncom,codcom,codprov&sortBy=ncom</a><br>
<br></div><div>But the response is quite strange because the response is not sorted on the "ncom" attribute,<br>and also<br></div><div>I see two attribute are lowercase and two are uppercase.<br><br></div><div>This is strange because the view is defined with the alias always lowercase.<br>
<br></div><div>However it now work and this is a good start point.<br><br></div></div>Thx,<br><br><div><div><div><div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/4/13 Rahkonen Jukka <span dir="ltr"><<a href="mailto:jukka.rahkonen@mmmtike.fi" target="_blank">jukka.rahkonen@mmmtike.fi</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I made some trials too. I used two different Windows binaries<br>
- MS4W with gdal18.dll (2011-08-12) and Mapserver 6.0.1<br>
- binaries from gisinternals including gdal110dev.dll (2013-03-24) and Mapserver 6.3dev<br>
<br>
Spatialite database was of version 3.0 and created with Spatialite-gui 1.5.0<br>
<br>
When I used MS4W with gdal18.dll  I could use Spatialite layers in two ways:<br>
CONNECTIONTYPE OGR<br>
CONNECTION "test.sqlite"<br>
DATA "layer"<br>
or with<br>
DATA "select GEOMETRY from layer"<br>
<br>
View did not work. Error was:<br>
msOGRFileOpen(): OGR error. GetLayer(layer_view) failed for OGR connection `test.sqlite'.<br>
<br>
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<br>
msOGRFileNextShape(): OGR error. Unable to query table layer(GEOMETRY) for column definitions : no such table: layer(GEOMETRY).<br>
<br>
View did not work with gdaldev110.dll and the error was again the same "no such table: layer(GEOMETRY)".<br>
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.<br>

<br>
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.<br>
<br>
-Jukka Rahkonen-<br>
<br>
<br>
________________________________<br>
Andrea Peri wrote<br>
<div class="im"><br>
> Hi,<br>
<br>
> googling I found this thread:<br>
</div>> <a href="http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028373.html" target="_blank">http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028373.html</a><<a href="http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028373.html" target="_blank">http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028373.html</a>><br>

<div class="im"><br>
> as reported in it seem that to see the spatialite view need to set the<br>
<br>
> SQLITE_LIST_ALL_TABLES<br>
<br>
> parameter.<br>
<br>
<br>
> Is this kind of sqlite/spatialite parameters settable for an ogr connection inside a mafile ?<br>
<br>
<br>
<br>
> Thx<br>
<br>
<br>
<br>
</div>2013/4/13 Andrea Peri <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a><mailto:<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>>><br>
<div class="im">Hi,<br>
thx for reply.<br>
<br>
I check your hint.<br>
As readable from spatialite documentation a spatial view seem need to registered on a special geometry column named:<br>
<br>
views_geometry_columns<br>
<br>
I add the view to this table but still the wfs seem don't understand any.<br>
<br>
This is what it return:<br>
<br>
<wfs:FeatureCollection<br>
    xsi:schemaLocation="<a href="http://mapserver.gis.umn.edu/mapserver" target="_blank">http://mapserver.gis.umn.edu/mapserver</a> <a href="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" target="_blank">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</a>  <a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a> <a href="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" target="_blank">http://schemas.opengis.net/wfs/1.1.0/wfs.xsd</a>"><br>

<gml:boundedBy><br>
  <gml:Null>missing</gml:Null><br>
</gml:boundedBy><br>
</wfs:FeatureCollection><br>
<br>
<br>
<br>
</div>2013/4/13 <<a href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</a><mailto:<a href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</a>>><br>
<div class="im"><br>
Hi Andrea,<br>
<br>
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.<br>
<br>
<br>
Brent Wood<br>
<br>
<br>
</div>--- On Sat, 4/13/13, aperi2007 <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a><mailto:<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>>> wrote:<br>
<br>
From: aperi2007 <<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a><mailto:<a href="mailto:aperi2007@gmail.com">aperi2007@gmail.com</a>>><br>
<div class="im">Subject: [mapserver-users] WFS on a view from a spatialite source<br>
</div>To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
<div class="im">Date: Saturday, April 13, 2013, 11:17 AM<br>
<br>
Hi,<br>
<br>
I'm try-ing to start a wfs service using a spatialite db as datasosurce.<br>
It work if I use a table.<br>
<br>
But using a spatial view it don't seem work<br>
It return a GML Bound NULL.<br>
<br>
I don't know if I'm wrong to set it.<br>
<br>
There is any on that as successfully use a spatial view of spatialite as datasource for wfs ?<br>
<br>
Thx,<br>
<br>
Andrea Peri<br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
</div><a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><<a href="http://mc/compose?to=mapserver-users@lists.osgeo.org" target="_blank">http://mc/compose?to=mapserver-users@lists.osgeo.org</a>><br>

<div class="HOEnZb"><div class="h5"><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
<br>
<br>
<br>
--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<br>
<br>
<br>
<br>
--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-----------------<br>Andrea Peri<br>. . . . . . . . . <br>qwerty àèìòù<br>-----------------<br>
</div>