Skip to content
Permalink
Browse files
OGR: implement expression conversion to Spatialite SQL
When serving a Spatialite DB through WFS for example, the WFS filter
was only evaluated on MapServer side instead of being evaluated by
SQLite + Spatialite functions.
  • Loading branch information
ajolma authored and rouault committed May 31, 2016
1 parent 1058774 commit 3cf682d17003521213868f1e727d7be7a3263c7e
Show file tree
Hide file tree
Showing 36 changed files with 7,123 additions and 289 deletions.
1,045 mapogr.cpp

Large diffs are not rendered by default.

Binary file not shown.
@@ -0,0 +1,133 @@
Content-Type: text/xml; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd
http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=towns&amp;OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>660036.840000,4879402.970000 690357.250000,4892926.890000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<!-- WARNING: FeatureId item 'ID' not found in typename 'towns'. -->
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>660036.840000,4885407.410000 660036.840000,4885407.410000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>660036.840000,4885407.410000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Sambuca Pistoiese</ms:name>
<ms:peoples>1604</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>672279.270000,4879402.970000 672279.270000,4879402.970000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>672279.270000,4879402.970000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Vernio</ms:name>
<ms:peoples>5535</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>666989.570000,4892926.890000 666989.570000,4892926.890000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>666989.570000,4892926.890000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Camugnano</ms:name>
<ms:peoples>2132</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>662773.000000,4891987.410000 662773.000000,4891987.410000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>662773.000000,4891987.410000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Castel di Casio</ms:name>
<ms:peoples>3174</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>673068.120000,4889949.750000 673068.120000,4889949.750000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>673068.120000,4889949.750000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Castiglione dei Pepoli</ms:name>
<ms:peoples>6008</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>690357.250000,4888070.830000 690357.250000,4888070.830000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>690357.250000,4888070.830000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Firenzuola</ms:name>
<ms:peoples>4812</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
</wfs:FeatureCollection>

@@ -0,0 +1,38 @@
Content-Type: text/xml; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd
http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=towns&amp;OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>643513.360000,4896928.190000 643513.360000,4896928.190000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<!-- WARNING: FeatureId item 'ID' not found in typename 'towns'. -->
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>643513.360000,4896928.190000 643513.360000,4896928.190000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>643513.360000,4896928.190000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Fanano</ms:name>
<ms:peoples>2910</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
</wfs:FeatureCollection>

@@ -0,0 +1,152 @@
Content-Type: text/xml; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd
http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=towns&amp;OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>643513.360000,4879402.970000 690357.250000,4896928.190000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<!-- WARNING: FeatureId item 'ID' not found in typename 'towns'. -->
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>660036.840000,4885407.410000 660036.840000,4885407.410000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>660036.840000,4885407.410000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Sambuca Pistoiese</ms:name>
<ms:peoples>1604</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>672279.270000,4879402.970000 672279.270000,4879402.970000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>672279.270000,4879402.970000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Vernio</ms:name>
<ms:peoples>5535</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>643513.360000,4896928.190000 643513.360000,4896928.190000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>643513.360000,4896928.190000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Fanano</ms:name>
<ms:peoples>2910</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>666989.570000,4892926.890000 666989.570000,4892926.890000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>666989.570000,4892926.890000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Camugnano</ms:name>
<ms:peoples>2132</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>662773.000000,4891987.410000 662773.000000,4891987.410000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>662773.000000,4891987.410000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Castel di Casio</ms:name>
<ms:peoples>3174</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>673068.120000,4889949.750000 673068.120000,4889949.750000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>673068.120000,4889949.750000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Castiglione dei Pepoli</ms:name>
<ms:peoples>6008</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
<gml:featureMember>
<ms:towns>
<gml:boundedBy>
<gml:Box srsName="EPSG:32632">
<gml:coordinates>690357.250000,4888070.830000 690357.250000,4888070.830000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Point srsName="EPSG:32632">
<gml:coordinates>690357.250000,4888070.830000</gml:coordinates>
</gml:Point>
</ms:msGeometry>
<ms:name>Firenzuola</ms:name>
<ms:peoples>4812</ms:peoples>
<ms:localcounc>1</ms:localcounc>
<ms:county>0</ms:county>
<ms:region>0</ms:region>
</ms:towns>
</gml:featureMember>
</wfs:FeatureCollection>

0 comments on commit 3cf682d

Please sign in to comment.