Skip to content

Commit

Permalink
Use direct import of ga's from_shape
Browse files Browse the repository at this point in the history
  • Loading branch information
dezhin committed Oct 2, 2020
1 parent 5e8a3d0 commit 340242d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nextgisweb/vector_layer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from sqlalchemy.ext.compiler import compiles

import geoalchemy2 as ga
from geoalchemy2.shape import from_shape as ga_from_shape
import sqlalchemy.sql as sql
from sqlalchemy import (
event,
Expand Down Expand Up @@ -507,7 +508,7 @@ def feature_put(self, feature):
# This will not let to write empty geometry, but it is not needed yet.

if feature.geom is not None:
obj.geom = ga.shape.from_shape(
obj.geom = ga_from_shape(
feature.geom, srid=self.srs_id)

DBSession.merge(obj)
Expand Down Expand Up @@ -535,7 +536,7 @@ def feature_create(self, feature):
if f.keyname in feature.fields.keys():
setattr(obj, f.key, feature.fields[f.keyname])

obj.geom = ga.shape.from_shape(
obj.geom = ga_from_shape(
feature.geom, srid=self.srs_id)

if feature.geom.geom_type.upper() != self.geometry_type:
Expand Down

0 comments on commit 340242d

Please sign in to comment.