Permalink
Browse files

[OGR] Fix wrong mapping of field indexes when SQL layer is composed, …

…e.g. with a WMS request on a Spatialite DB.
  • Loading branch information...
rouault committed Jul 2, 2016
1 parent b007fdb commit 5c8f20124f3867d68dee38aa51ebf04d6ee85760
Showing with 66 additions and 0 deletions.
  1. +2 −0 mapogr.cpp
  2. BIN msautotest/wxs/expected/wms_ogr_native.png
  3. +64 −0 msautotest/wxs/wms_ogr_native_sql.map
View
@@ -1809,6 +1809,8 @@ static int msOGRFileWhichShapes(layerObj *layer, rectObj rect, msOGRFileInfo *ps
}
msFree(select);
+ // Update itemindexes / layer->iteminfo
+ msOGRLayerInitItemInfo(layer);
}
else {
Binary file not shown.
@@ -0,0 +1,64 @@
+#
+# Test WMS
+#
+# REQUIRES: SUPPORTS=WMS INPUT=OGR
+#
+# simple bbox
+#
+# RUN_PARMS: wms_ogr_native.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&TYPENAME=towns&FORMAT=image/png&BBOX=659159,4877386,696879,4898059&LAYERS=towns&WIDTH=100&HEIGHT=100&SRS=EPSG:32632" > [RESULT_DEMIME]
+
+MAP
+
+NAME WMS_OGR_NATIVE_SQL_TEST
+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
+ "wms_title" "Test simple wms"
+ "wms_onlineresource" "http://localhost/path/to/wms_simple?"
+ "wms_srs" "EPSG:32632"
+ "wms_enable_request" "*"
+ END
+END
+
+PROJECTION
+ "+proj=latlong +datum=WGS84"
+END
+
+#
+# Start of layer definitions
+#
+
+LAYER
+ NAME towns
+ DATA towns
+ CONNECTIONTYPE OGR
+ CONNECTION "./data/db.sqlite"
+ PROCESSING "NATIVE_SQL=YES"
+ TYPE POINT
+ STATUS ON
+ PROJECTION
+ "init=epsg:32632"
+ END
+ CLASS
+ TEXT '[peoples]'
+ LABEL
+ END
+ END
+
+ TEMPLATE "foo"
+END # Layer
+
+END # Map File

0 comments on commit 5c8f201

Please sign in to comment.