Skip to content

Commit 5c8f201

Browse files
committed
[OGR] Fix wrong mapping of field indexes when SQL layer is composed, e.g. with a WMS request on a Spatialite DB.
1 parent b007fdb commit 5c8f201

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

mapogr.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,8 @@ static int msOGRFileWhichShapes(layerObj *layer, rectObj rect, msOGRFileInfo *ps
18091809
}
18101810
msFree(select);
18111811

1812+
// Update itemindexes / layer->iteminfo
1813+
msOGRLayerInitItemInfo(layer);
18121814
}
18131815
else {
18141816

2.63 KB
Loading

msautotest/wxs/wms_ogr_native_sql.map

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#
2+
# Test WMS
3+
#
4+
# REQUIRES: SUPPORTS=WMS INPUT=OGR
5+
#
6+
# simple bbox
7+
#
8+
# 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]
9+
10+
MAP
11+
12+
NAME WMS_OGR_NATIVE_SQL_TEST
13+
STATUS ON
14+
SIZE 400 300
15+
EXTENT 6 30 21 50
16+
UNITS METERS
17+
IMAGECOLOR 255 255 255
18+
19+
#
20+
# Start of web interface definition
21+
#
22+
23+
WEB
24+
25+
IMAGEPATH "tmp/"
26+
IMAGEURL "/ms_tmp/"
27+
28+
METADATA
29+
"wms_title" "Test simple wms"
30+
"wms_onlineresource" "http://localhost/path/to/wms_simple?"
31+
"wms_srs" "EPSG:32632"
32+
"wms_enable_request" "*"
33+
END
34+
END
35+
36+
PROJECTION
37+
"+proj=latlong +datum=WGS84"
38+
END
39+
40+
#
41+
# Start of layer definitions
42+
#
43+
44+
LAYER
45+
NAME towns
46+
DATA towns
47+
CONNECTIONTYPE OGR
48+
CONNECTION "./data/db.sqlite"
49+
PROCESSING "NATIVE_SQL=YES"
50+
TYPE POINT
51+
STATUS ON
52+
PROJECTION
53+
"init=epsg:32632"
54+
END
55+
CLASS
56+
TEXT '[peoples]'
57+
LABEL
58+
END
59+
END
60+
61+
TEMPLATE "foo"
62+
END # Layer
63+
64+
END # Map File

0 commit comments

Comments
 (0)