Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
da6eabd7
Commit
da6eabd7
authored
Mar 07, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands to use geom type
parent
af70c61f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
updateCompleteToWKT.py
catalog/management/commands/updateCompleteToWKT.py
+14
-0
No files found.
catalog/management/commands/updateCompleteToWKT.py
View file @
da6eabd7
...
@@ -26,3 +26,17 @@ class Command(BaseCommand):
...
@@ -26,3 +26,17 @@ class Command(BaseCommand):
def
_ignore
(
self
,
polygons
,
names
):
def
_ignore
(
self
,
polygons
,
names
):
to_ignore
=
names
.
split
(
','
)
to_ignore
=
names
.
split
(
','
)
return
[
p
for
p
in
polygons
if
p
.
name
not
in
to_ignore
]
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);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment