Skip to content

Commit 1e27657

Browse files
authored
feature_info_service remove 3rd dimension from point coord
1 parent 0ada216 commit 1e27657

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/feature_info_service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,10 @@ def get_layer_info(self, identity, origin, service_name, layer, style, x, y, crs
534534

535535
if geomcentroid and geometry:
536536
gj = wkt.loads(geometry.upper().replace('Z',''))
537+
if gj["type"] == "POINT" and len(gj["coordinates"]) == 3:
538+
gj["coordinates"] = gj["coordinates"][:2]
539+
if gj["type"] == "MULTIPOINT" and len(gj["coordinates"][0])==3:
540+
for i, c in enumerate(gj["coordinates"]): gj["coordinates"][i] = c[:2]
537541
geometry = wkt.dumps({
538542
"type": "Point",
539543
"coordinates": geom_center(gj["type"], gj["coordinates"])

0 commit comments

Comments
 (0)