-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OGR GPKG: fix potential SELECT ambiguity for 'id' column (fixes #5858)
When using a GeoPackage table that has a 'id' column, in some circumstances, MapServer composes internally a SELECT statement, but fails to prefix the id column with the table name, which causes an ambiguity when joining with the spatial index RTree table that has also a id column.
- Loading branch information
Showing
4 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=test&OUTPUTFORMAT=XMLSCHEMA"> | ||
<gml:boundedBy> | ||
<gml:Box srsName="EPSG:4326"> | ||
<gml:coordinates>2.000000,49.000000 2.000000,49.000000</gml:coordinates> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
<gml:featureMember> | ||
<ms:test fid="test.1"> | ||
<gml:boundedBy> | ||
<gml:Box srsName="EPSG:4326"> | ||
<gml:coordinates>2.000000,49.000000 2.000000,49.000000</gml:coordinates> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
<ms:msGeometry> | ||
<gml:Point srsName="EPSG:4326"> | ||
<gml:coordinates>2.000000,49.000000</gml:coordinates> | ||
</gml:Point> | ||
</ms:msGeometry> | ||
<ms:id>1</ms:id> | ||
<ms:name>some place in France</ms:name> | ||
</ms:test> | ||
</gml:featureMember> | ||
</wfs:FeatureCollection> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# Test OGR GeoPackage support | ||
# | ||
# REQUIRES: SUPPORTS=WFS INPUT=OGR | ||
# | ||
# RUN_PARMS: wfs_ogr_gpkg_issue_5858.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=test&BBOX=-180,-90,180,90&MAXFEATURES=1" > [RESULT] | ||
|
||
MAP | ||
|
||
NAME WFS_OGR_GPKG | ||
STATUS ON | ||
SIZE 400 300 | ||
EXTENT 6 30 21 50 | ||
UNITS METERS | ||
IMAGECOLOR 255 255 255 | ||
|
||
# | ||
# Start of web interface definition | ||
# | ||
|
||
WEB | ||
|
||
IMAGEPATH "tmp/" | ||
IMAGEURL "/ms_tmp/" | ||
|
||
METADATA | ||
"wfs_title" "Test simple wfs" | ||
"wfs_onlineresource" "http://localhost/path/to/wfs_simple?" | ||
"wfs_srs" "EPSG:4326" | ||
"wfs_enable_request" "*" | ||
END | ||
END | ||
|
||
PROJECTION | ||
"+proj=latlong +datum=WGS84" | ||
END | ||
|
||
# | ||
# Start of layer definitions | ||
# | ||
|
||
LAYER | ||
|
||
NAME test | ||
DATA test | ||
CONNECTIONTYPE OGR | ||
CONNECTION "./data/test.gpkg" | ||
METADATA | ||
"ows_title" "test" | ||
"wfs_featureid" "id" | ||
"gml_include_items" "all" | ||
"gml_types" "auto" | ||
END | ||
TYPE POINT | ||
STATUS ON | ||
PROJECTION | ||
"init=epsg:4326" | ||
END | ||
|
||
TEMPLATE "wfs_ogr_gpkg.map" | ||
END # Layer | ||
|
||
END # Map File |