commands to use geom type

parent af70c61f
......@@ -26,3 +26,17 @@ class Command(BaseCommand):
def _ignore(self, polygons, names):
to_ignore = names.split(',')
return [p for p in polygons if p.name not in to_ignore]
# -- view
# SELECT ST_AsText(geom) FROM catalog_polygon LIMIT 1;
#
# -- add column
# ALTER TABLE catalog_polygon ADD COLUMN geom geometry(Geometry,4326);
#
# -- pupulate
# update catalog_polygon as p set geom = ST_GeomFromText(c.wkt_polygon,4326) from catalog_polygon c where p.id=c.id;
#
# -- convert geom (if)
# ALTER TABLE catalog_polygon ALTER COLUMN geom TYPE Geometry USING geom::Geometry;
# ALTER TABLE catalog_polygon ALTER COLUMN geom TYPE Geometry(Geometry, 4326) USING ST_SetSRID(geom::Geometry,4326);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment