Skip to content

Commit

Permalink
Change logic for choosing ST_GEOMETRY vs ST_GeomFromText
Browse files Browse the repository at this point in the history
  • Loading branch information
mbjackson-capp committed Oct 11, 2024
1 parent 4c185af commit d7777a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion geopetl/postgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def prepare_val(self, val, type_):
def _prepare_geom(self, geom, srid, transform_srid=None, multi_geom=True):
"""Prepares WKT geometry by projecting and casting as necessary."""
# if DB is sde enabled
if self.db.is_sde_enabled is True:
if (self.db.is_sde_enabled is True) and not (self.db.is_postgis_enabled is True):
geom = "ST_GEOMETRY('{}', {})".format(geom, srid) if geom and geom != 'EMPTY' else "null"
# if DB is postgis enabled
elif self.db.is_postgis_enabled is True:
Expand Down

0 comments on commit d7777a1

Please sign in to comment.