Skip to content

Commit

Permalink
Fix m output instead of z for GeoJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Trigona-Harany committed Sep 8, 2024
1 parent f0d9713 commit 3b0dd68
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions plpygis/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def _to_shapely(self):
raise DependencyError("Shapely")

def _to_geojson(self):
coordinates = self._to_geojson_coordinates()
coordinates = self._coordinates(dimm=False, tpl=False)
geojson = {"type": self.type, "coordinates": coordinates}
return geojson

Expand Down Expand Up @@ -598,9 +598,6 @@ def _set_multi_metadata(self):
def _coordinates(self, dimz=True, dimm=True, tpl=True):
return [g._coordinates(dimz, dimm, tpl) for g in self.geometries]

def _to_geojson_coordinates(self):
return self._coordinates(dimm=False, tpl=False)

def _load_geometry(self):
self._geometries = _MultiGeometry._read_wkb(
self._reader, self._dimz, self._dimm
Expand Down Expand Up @@ -841,9 +838,6 @@ def _coordinates(self, dimz=True, dimm=True, tpl=True):
return coordinates
return list(coordinates)

def _to_geojson_coordinates(self):
return self._coordinates(dimm=False, tpl=False)

def _bounds(self):
return (self.x, self.y, self.x, self.y)

Expand Down Expand Up @@ -979,9 +973,6 @@ def dimm(self, value):
def _coordinates(self, dimz=True, dimm=True, tpl=True):
return [v._coordinates(dimz, dimm, tpl) for v in self.vertices]

def _to_geojson_coordinates(self):
return self._coordinates(dimz=False, tpl=False)

def _bounds(self):
x = [v.x for v in self.vertices]
y = [v.y for v in self.vertices]
Expand Down Expand Up @@ -1126,9 +1117,6 @@ def dimm(self, value):
def _coordinates(self, dimz=True, dimm=True, tpl=True):
return [r._coordinates(dimz, dimm, tpl) for r in self.rings]

def _to_geojson_coordinates(self):
return self._coordinates(dimz=False, tpl=False)

def _bounds(self):
return self.exterior.bounds

Expand Down

0 comments on commit 3b0dd68

Please sign in to comment.