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
d718e1a6
Commit
d718e1a6
authored
May 21, 2018
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start pupulate script
parent
1ff4c785
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
1 deletion
+21
-1
settings.pyc
GeoInt_SIDT/settings.pyc
+0
-0
__init__.pyc
catalog/management/__init__.pyc
+0
-0
__init__.pyc
catalog/management/commands/__init__.pyc
+0
-0
populate_db.py
catalog/management/commands/populate_db.py
+21
-1
populate_db.pyc
catalog/management/commands/populate_db.pyc
+0
-0
No files found.
GeoInt_SIDT/settings.pyc
View file @
d718e1a6
No preview for this file type
catalog/management/__init__.pyc
0 → 100644
View file @
d718e1a6
File added
catalog/management/commands/__init__.pyc
0 → 100644
View file @
d718e1a6
File added
catalog/management/commands/populate_db.py
View file @
d718e1a6
...
@@ -4,4 +4,24 @@ from django.core.management.base import BaseCommand, CommandError
...
@@ -4,4 +4,24 @@ from django.core.management.base import BaseCommand, CommandError
from
catalog.models
import
State
,
City
from
catalog.models
import
State
,
City
import
json
,
unicodedata
import
json
,
unicodedata
# code here
class
Command
(
BaseCommand
):
\ No newline at end of file
def
handle
(
self
,
*
args
,
**
options
):
#base path
base_path
=
'/home/emmanuelhp/Documentos/geojson/'
# loads files
for
index
in
range
(
1
,
33
):
with
open
(
base_path
+
str
(
index
)
+
'.geojson'
)
as
f
:
data
=
json
.
load
(
f
)
print
"Estado: "
,
data
[
'name'
]
# print ("============= "+ data['name'] + " ===================")
# for feature in data['features']:
# print ("NOMGEO: ", feature['properties']['NOMGEO'])
# print ("CVE_ENT: ", feature['properties']['CVE_ENT'])
# print ("CVE_MUN: ", feature['properties']['CVE_MUN'])
# print ("CVEGEO: ", feature['properties']['CVEGEO'])
# print ("coordinates: ", feature['geometry']['coordinates'])
# print ("_____________________________________________")
\ No newline at end of file
catalog/management/commands/populate_db.pyc
0 → 100644
View file @
d718e1a6
File added
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