import csv scripts and added initial data
This commit is contained in:
parent
7f58c7acdd
commit
22f7b28dff
11
data/Beach.csv
Normal file
11
data/Beach.csv
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
Sr No. Name Location Area (sqm)
|
||||||
|
1 Girgaon Girgaon 161985.33
|
||||||
|
2 Prabhadevi Prabhadevi (including nourishment) 35373.94
|
||||||
|
3 Dadar Dadar 18788.57
|
||||||
|
4 Mahim Mahim 14376.31
|
||||||
|
5 Juhu Juhu 314930.06
|
||||||
|
6 Versova Versova 338484.43
|
||||||
|
7 Madh Madh 164248.24
|
||||||
|
8 Erangal Erangal 19388.28
|
||||||
|
9 Aksa Aksa 296997.71
|
||||||
|
10 Manori Manori 31764.76
|
|
10
data/CreekWetland.csv
Normal file
10
data/CreekWetland.csv
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Sr No. Name Location Creek Area Proposed Development Area Creek and Development Area
|
||||||
|
1 Malad Creek Located at the west of Malad west and continues till Malad Marve Rd. 2990463 117000 3107463
|
||||||
|
2 Trombay Creek Mankhurd 1013750.32 207000 1220750
|
||||||
|
3 Creek Near Mulund East Mulund East 113050.41 113050.41
|
||||||
|
4 Creek at sewri Sewree 70857.89 70857.89
|
||||||
|
|
||||||
|
5 Manori Creek 4415577.9 4415577.9
|
||||||
|
6 Creeks near Ghatkopar Ghatkopar East 370069.56 370069.56
|
||||||
|
7 Creeks near Vikhroli 202920.72 202920.72
|
||||||
|
8 Creeks near mulund 70392.71 70392.71
|
|
7
data/Forest.csv
Normal file
7
data/Forest.csv
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Sr No. Name Location Area (sqm)
|
||||||
|
1 Juhu Forest Juhu, Beside Irla Nala 29687.6
|
||||||
|
2 Mahim Nature Park Mahim 18826.32
|
||||||
|
3 Mumbai Port trust Garden Near Colaba Causeway Rd 49398.43
|
||||||
|
4 Veer Jijabai Bhosale Udyan Dr. Babasaheb Ambedkar Rd, Byculla E, Mumbai-27 216936
|
||||||
|
5 Proposed City Forest Goregaon West 1300000
|
||||||
|
6 Proposed City Forest Chembur West 200000
|
|
7
data/Fort.csv
Normal file
7
data/Fort.csv
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Sr. No Name Location Area(sq m)
|
||||||
|
1 Sewri Fort Sewri 9569.95
|
||||||
|
2 Bandra Fort Bandra 8950.19
|
||||||
|
3 Sion Fort Sion 53810.02
|
||||||
|
4 Kala Killa Dharavi 1292.85
|
||||||
|
5 Worli Fort Koliwada 4969.15
|
||||||
|
6 Mahim Fort Mahim 4328.07
|
|
5
data/HillForest.csv
Normal file
5
data/HillForest.csv
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
Sr No. Name Location Area (sq m)
|
||||||
|
1 Madala Hill Chembur 6333524.54
|
||||||
|
2 Gilbert Hill Andheri 6195.11
|
||||||
|
3 Sanjay Gandhi National Park Borivali 46685597.1
|
||||||
|
4 Aarey Milk Colony Goregaon 11230000
|
|
60
data/MillLand.csv
Normal file
60
data/MillLand.csv
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
Sr No Name Location Old Name Owner
|
||||||
|
|
||||||
|
1 Kohinoor Mills no.3 Dadar West NTC Maharashtra North
|
||||||
|
2 India United Dye Works no.6 (North) Dadar West NTC Maharashtra North
|
||||||
|
3 Elphinstone Mills Elphinstone Road NTC Maharashtra North
|
||||||
|
4 Jupiter Mills Lower Parel NTC Maharashtra South
|
||||||
|
5 Shree Madhusudan Mills Lower Parel NTC Maharashtra South
|
||||||
|
6 Jam Mills NTC
|
||||||
|
7 Sitaram Mills NTC
|
||||||
|
8 New Hind Textile Mills Kalachowky Kaiser-i-Hind MHADA
|
||||||
|
9 Kohinoor Mills no.1 Dadar East NTC Maharashtra North
|
||||||
|
10 Kohinoor Mills no.2 Dadar East NTC Maharashtra North
|
||||||
|
11 Tata Mills Parel NTC Maharashtra North
|
||||||
|
12 Mumbai Textile Mills Sakseria Mills NTC
|
||||||
|
13 Bharat Mills NTC
|
||||||
|
14 Digvijay Mills Lalbaug NTC
|
||||||
|
15 Apollo Mills (South) NTC Maharashtra South
|
||||||
|
16 India United Mills no.4 Kalachowky NTC
|
||||||
|
17 India United Mills no.2 Kalachowky MCGM
|
||||||
|
18 India United Mills no.3 Kalachowky MCGM
|
||||||
|
19 India United Mills no.5 Kalachowky NTC
|
||||||
|
20 Gold Mohur Mills Dadar East NTC
|
||||||
|
21 Poddar Processors Edward Mills NTC
|
||||||
|
22 India United Mills no.1 Lalbaug David Mills NTC Maharashtra North
|
||||||
|
23 Finlay Mills Parel NTC
|
||||||
|
24 Poddar Mills NTC
|
||||||
|
25 New City of Bombay Manufacturing Mills Kalachowky NTC
|
||||||
|
26 Western India Spinning & Weaving Mills Maharashtra State Textile Corporation
|
||||||
|
27 Swadeshi Mills Private
|
||||||
|
28 Standard Mills Prabhadevi Private
|
||||||
|
29 Matulya Mills Private
|
||||||
|
30 Phoenix Mills Lower Parel Private
|
||||||
|
31 Modern Mills Jacob Circle Private
|
||||||
|
32 Hindoostan Spinning & Weaving Mills no.1 Jacob Circle Private
|
||||||
|
33 Hindoostan Spinning & Weaving Mills no.2 Jacob Circle Private
|
||||||
|
34 Ruby Mills Dadar West Private
|
||||||
|
35 Hindoostan Spinning & Weaving Mills no.3 Crown Mills Private
|
||||||
|
36 Spring Mills Naigaon Private
|
||||||
|
37 Victoria Mills Lower Parel Private
|
||||||
|
38 Gokuldas Morarjee Mills no.1 Lalbaug Private
|
||||||
|
39 Swan Mills Private
|
||||||
|
40 Mafatlal Mills no.3 Byculla Private
|
||||||
|
41 Khatau Makanji Spinning & Weaving Mills Byculla Private
|
||||||
|
42 Century Spinning & Weaving Mills Prabhadevi Private
|
||||||
|
42 Bombay Dyeing & Manufacturing Company Lower Parel Private
|
||||||
|
43 Prakash Cotton Mills Private
|
||||||
|
44 Shriniwas Mills Lower Parel Private
|
||||||
|
45 Kamala Mills Lower Parel Private
|
||||||
|
46 Shree Ram Mills Worli Private
|
||||||
|
47 Gokuldas Morarjee Mills no.2 Private
|
||||||
|
48 Dawn Mills Private
|
||||||
|
49 Standard Mills no.2 Private
|
||||||
|
50 Piramal Spinning & Weaving Mills Lower Parel Private
|
||||||
|
51 Raghuvanshi Mills Lower Parel Private
|
||||||
|
52 New Great Eastern Spinning & Weaving Mills Byculla Private
|
||||||
|
53 Simplex Mills Private
|
||||||
|
54 Bradbury Mills Private
|
||||||
|
55 Mafatlal Mills no.1 Delisle Road Private
|
||||||
|
56 Mafatlal Mills no.2 Delisle Road Private
|
||||||
|
57 Mukesh Textile Mills Colaba Private
|
|
32
data/Nullah.csv
Normal file
32
data/Nullah.csv
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
Sr No. Name Location Area (sqm) of nala Area (sqm) Area (sqm)
|
||||||
|
Of proposed development including development
|
||||||
|
1 Irla Nullah Juhu 149254.7 175600.6 324855.3
|
||||||
|
|
||||||
|
2 Kurla Nullah Originates in Tilak Nagar and meets in Arabian sea along Chembur Sewri Rd. 248061.46 163135.2 411196.7
|
||||||
|
|
||||||
|
3 Mahalaxmi Nullah Originates from Dr E Moses Marg and continues till Arabian Sea 33761.6 35956.18 69717.78
|
||||||
|
|
||||||
|
4 Bandra Kurla Complex Nullah Originates from mithi river and continues till Sahar Airport 102790.16 121671.9 224462.1
|
||||||
|
|
||||||
|
5 Govandi Nullah 105438.2 92661.84 198100
|
||||||
|
6 Chembur Nullah 25597.39 39735.04 65332.43
|
||||||
|
|
||||||
|
7 Ghatkopar Nullah 70691.58 14376.45 85068.03
|
||||||
|
|
||||||
|
8 Jogeshwari W Nullah Originates from Malad creek and flows through Jogeshwari W 82085.64 60264.36 142350
|
||||||
|
|
||||||
|
9 Oshiwara Nullah Originates at Oshiwara River and flows through Jogeshwari 38025.52 67578.29 105603.8
|
||||||
|
|
||||||
|
10 Vikhroli Nullah 62509.85 30027.21 92537.06
|
||||||
|
|
||||||
|
11 Mulund Nullah 26231.8 102594.2 128826
|
||||||
|
|
||||||
|
12 Kandivali Nullah Kandivali 169722.2 211072 380794.2
|
||||||
|
|
||||||
|
13 Bhandup Nullah Bhandup East 429189.76 109222.45 538412.2
|
||||||
|
|
||||||
|
14 Aarey Milk Colony Nullah 147557.8 159755.5 307313.3
|
||||||
|
|
||||||
|
15 Prabhadevi Nullah Near Kalanagar, Prabhadevi 11398.52 36480.67 47879.19
|
||||||
|
|
||||||
|
16 Dahisar Nullah 33995.08 61429.97 95425.05
|
|
2121
data/OpenSpace.csv
Normal file
2121
data/OpenSpace.csv
Normal file
File diff suppressed because it is too large
Load Diff
75
data/PedestrianAvenue.csv
Normal file
75
data/PedestrianAvenue.csv
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
Sr No. Name Length in kms
|
||||||
|
1 Shahid Bhagat Singh Road 4.1
|
||||||
|
2 Gopi Prakash Marg 4.2
|
||||||
|
3 Madam Cama Road 1.2
|
||||||
|
4 Veer Nariman Road 1.2
|
||||||
|
5 Nathalal Parikh Road 0.8
|
||||||
|
6 Shahid Bhagat Singh Road 2.8
|
||||||
|
7 P D Mello Road 1.9
|
||||||
|
8 Marine Drive 4.5
|
||||||
|
9 Valkeshwar Road 1.8
|
||||||
|
10 Maharshi karve Road 0.8
|
||||||
|
11 J Shankar Sheth Marg 2.9
|
||||||
|
12 D N Road 2.72
|
||||||
|
13 Lokmanya Tilak Marg 1.4
|
||||||
|
14 Mohammed Ali Road 2
|
||||||
|
15 Sardar Vallabhai Patel Road 2.8
|
||||||
|
16 A K Marg 2
|
||||||
|
17 L Jagmohandas Marg 1.8
|
||||||
|
18 Lamington Road 1.5
|
||||||
|
19 Dr. Anandrao Nair Marg 1.5
|
||||||
|
20 Sane Guruji Marg 1.7
|
||||||
|
21 N M Joshi Marg 4.1
|
||||||
|
22 Alibhai Premji Road 1.5
|
||||||
|
23 Belasis Road 1.5
|
||||||
|
24 Javji Dadaji Marg 1
|
||||||
|
25 Pandit Madan Mohan Malvia marg 1
|
||||||
|
26 Bhaulabhai Desai Marg 3.7
|
||||||
|
27 Keshav Road Khadye Road 2.2
|
||||||
|
28 Lala Lajpathrai Marg 1.2
|
||||||
|
29 Dr Annie Besant Road 3.1
|
||||||
|
30 Woli Sea Face 2.8
|
||||||
|
31 Prabhadevi New Road 0.6
|
||||||
|
32 Swatantra Veer Savarkar Marg 4.1
|
||||||
|
33 Swami Vivekanand Road 28.8
|
||||||
|
34 Senapati Bapat Road 7
|
||||||
|
35 Barrister Nath Pai Marg 3.6
|
||||||
|
36 Rafi Ahmed Kidwai Marg 4.3
|
||||||
|
37 Dr. Babasaheb Ambedkar Road 4.8
|
||||||
|
38 G D Ambedkar Marg 2.5
|
||||||
|
39 Jaggannath Bhatankar Marg 1.7
|
||||||
|
40 Lady Jehangir Road 1
|
||||||
|
41 Shitladevi Temple Road 9.3
|
||||||
|
42 Eastern Express Highway 14.5
|
||||||
|
43 Mahim Sion Link Road 2
|
||||||
|
44 Western Express Highway 24.8
|
||||||
|
45 Mahim Bandra Link Road 1
|
||||||
|
46 Linking Road 3.9
|
||||||
|
47 B K C Road 3.8
|
||||||
|
48 S G Barve Marg 3.7
|
||||||
|
49 Jawaharlal Nehru Road 1.2
|
||||||
|
50 Air India Road 2.6
|
||||||
|
51 L B S Marg 20.1
|
||||||
|
52 Jai Prakash Road 4.3
|
||||||
|
53 Madhurdas Vasanji Road 8.2
|
||||||
|
54 Gulmohar Road 1.7
|
||||||
|
55 Phadke Marg 2.2
|
||||||
|
56 Guru Hargovind Marg 1.3
|
||||||
|
57 Sahar Road 2.8
|
||||||
|
58 Marol Pipe line Road 1.2
|
||||||
|
59 Devle Road 1.1
|
||||||
|
60 Link Road 22.2
|
||||||
|
61 Behram Baug Road 1
|
||||||
|
62 Ramkrishna Chemburkar Marg 2
|
||||||
|
63 Bhikanji Damaji Patil Marg 2.1
|
||||||
|
64 Corridor Road 1.5
|
||||||
|
65 V N Purav Marg 4.5
|
||||||
|
66 Yashwanth Rao Chavan Marg 1.75
|
||||||
|
67 Jeejabai Bhosle Marg 4
|
||||||
|
68 Jogeshwari Vikroli Link Road 10.2
|
||||||
|
69 Goregaon Mulund Link Road 3.4
|
||||||
|
70 Mahatma Gandhi Road 1.1
|
||||||
|
71 Vasari Hill Road 5.6
|
||||||
|
72 Malad Marve Road 4.8
|
||||||
|
73 Mahatma Gandhi road 3.7
|
||||||
|
74 Lokmanya Tilak Road 3.4
|
|
10
data/River.csv
Normal file
10
data/River.csv
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Sr No. Name Location River Area Proposed Development Area River and Development Area
|
||||||
|
998164.2 1080000 2078164.2
|
||||||
|
1 Mithi River Originates from the overflow of Vihar Lake, flows through Arey Milk Colony, Powai, Saki Naka, Kurla, Kalina, Vakola, Bandra-Kurla complex, Dharavi and Mahim and meets the Arabian sea.
|
||||||
|
|
||||||
|
284280.5 432000 716280.5
|
||||||
|
2 Oshiwara River Starts from Sanjay Gandhi National Park and meets in Arabian Sea at Versova Creek
|
||||||
|
161248.4 660000 821248.4
|
||||||
|
3 Dahisar River Originates from Tulsi lake in Sanjay Gandhi National Park and meets the manori Creek
|
||||||
|
57067.75 270000 327067.75
|
||||||
|
4 Poisar Borivali West
|
|
27
data/WaterBody.csv
Normal file
27
data/WaterBody.csv
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
Sr No. Name Location Water Body Area Proposed Development Area Water Body and Development Area
|
||||||
|
1 Banganga Tank Malabar Hill 2073 1950.67 4023.67
|
||||||
|
2 Bandra Talao S.V.Rd, Near Bandra Station W 24401.5 3155.58 27557.08
|
||||||
|
|
||||||
|
3 Water Body Water body at BKC 61196.19 61196.19
|
||||||
|
|
||||||
|
4 Bhavans Lake Andheri W 10469.74 10469.74
|
||||||
|
5 Deval Talao Near Seepz Rd A, Andheri E 15610.83 4108.15 19718.98
|
||||||
|
|
||||||
|
6 Chandivali Lake Near Chandivali Farm Rd, Chandivali 38324.17 11550.22 49874.39
|
||||||
|
|
||||||
|
7 Nitie Pond Powai 15342.04 15342.04
|
||||||
|
8 Aarey Tank Aarey colony, Goregaon E 21966.21 21966.21
|
||||||
|
9 Kharodi Lake Malad West 20639.37 20639.37
|
||||||
|
10 Charkop Village Lake Charkop 7321.94 7321.94
|
||||||
|
11 Bhujavale Talao Nr link Rd, Malad W 2744.24 2744.24
|
||||||
|
12 Jhasi Ki Rani Laxmibai Udyan Link Rd, Borivali W 7875.74 7875.74
|
||||||
|
13 Eksar Talao Borivali W 2017.26 2017.26
|
||||||
|
14 Lokmanya Tilak Visarjan Talao Jogeshwari –Vikhroli Link Rd, Jogeshwari E 4371.22 4371.22
|
||||||
|
15 SCI Pond Chandivali 7563.41 7563.41
|
||||||
|
16 Sheetal Lake LBS Rd, Sakinaka 11364.27 11364.27
|
||||||
|
17 Teen Talao Hemu Kalani Marg, Chembur 5267.4 5267.4
|
||||||
|
18 Ishwar Kund Bhandup W 20350.65 20350.65
|
||||||
|
19 Water Body Bhandup W 8222.85 8222.85
|
||||||
|
20 Powai Lake 1510165.39 1510165.39
|
||||||
|
21 Vihar Lake 4214866.94 4214866.94
|
||||||
|
22 Tulsi Lake 1187856.86 1187856.86
|
|
8
data/Waterfront.csv
Normal file
8
data/Waterfront.csv
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
Sr No. Name Location Area (sqm)
|
||||||
|
1 Gateway Gateway 18091.85
|
||||||
|
2 Marine Drive Marine Drive 83217.9
|
||||||
|
3 Haji-Ali Haji-Ali 10227.03
|
||||||
|
4 Worli Worli 43579.37
|
||||||
|
5 Bandstand Bandra 14197.41
|
||||||
|
6 Carter Road Bandra 16044.79
|
||||||
|
7 Land’s End Bandra Fort 18651.59
|
|
|
@ -1,5 +1,6 @@
|
||||||
from django.contrib.gis.db import models
|
from django.contrib.gis.db import models
|
||||||
import datetime
|
import datetime
|
||||||
|
from os.path import join
|
||||||
|
|
||||||
class BaseModel(models.Model):
|
class BaseModel(models.Model):
|
||||||
changed = models.DateTimeField(null=True, editable=False)
|
changed = models.DateTimeField(null=True, editable=False)
|
||||||
|
@ -13,6 +14,60 @@ class BaseModel(models.Model):
|
||||||
self.created = self.changed
|
self.created = self.changed
|
||||||
super(BaseModel, self).save(*args, **kwargs)
|
super(BaseModel, self).save(*args, **kwargs)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def import_from_csv(kls):
|
||||||
|
import csv
|
||||||
|
from settings import PROJECT_ROOT
|
||||||
|
from django.db.models import CharField, TextField, IntegerField, DecimalField, FloatField
|
||||||
|
from decimal import Decimal
|
||||||
|
import json
|
||||||
|
import pdb
|
||||||
|
model_name = kls.__name__
|
||||||
|
filename = join(PROJECT_ROOT, "../data/%s.csv" % model_name)
|
||||||
|
error_file = open(join(PROJECT_ROOT, "../errors/%s.json" % model_name), "w")
|
||||||
|
errors = []
|
||||||
|
fields = kls._meta.fields[3:] #get all fields (excluding first 3 - id, changed, created)
|
||||||
|
CsvFile = csv.reader(open(filename), delimiter="\t")
|
||||||
|
header = True
|
||||||
|
for row in CsvFile:
|
||||||
|
#silly, to check if is first row, then is header, omit.
|
||||||
|
if header == True:
|
||||||
|
header = False
|
||||||
|
continue
|
||||||
|
i = 0
|
||||||
|
data = {}
|
||||||
|
for col in row:
|
||||||
|
field = fields[i]
|
||||||
|
fieldname = field.name
|
||||||
|
val = col.strip()
|
||||||
|
if isinstance(field, IntegerField):
|
||||||
|
try:
|
||||||
|
val = int(val)
|
||||||
|
except:
|
||||||
|
errors.append(row)
|
||||||
|
val = 0
|
||||||
|
elif isinstance(field, DecimalField):
|
||||||
|
try:
|
||||||
|
val = Decimal(val)
|
||||||
|
except:
|
||||||
|
errors.append(row)
|
||||||
|
val = 0.0
|
||||||
|
elif isinstance(field, FloatField):
|
||||||
|
try:
|
||||||
|
val = float(val)
|
||||||
|
except:
|
||||||
|
errors.append(row)
|
||||||
|
val = 0.0
|
||||||
|
data[fieldname] = val
|
||||||
|
i += 1
|
||||||
|
#pdb.set_trace()
|
||||||
|
obj = kls(**data) #FIXME: make this get_or_create
|
||||||
|
obj.save()
|
||||||
|
|
||||||
|
error_file.write(json.dumps(errors, indent=2))
|
||||||
|
error_file.close()
|
||||||
|
print "imported %ss" % model_name
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
|
|
|
@ -5,18 +5,23 @@ from models import *
|
||||||
#from django.contrib.admin import SimpleListFilter
|
#from django.contrib.admin import SimpleListFilter
|
||||||
#from ajax_select.fields import AutoCompleteSelectMultipleField, AutoCompleteSelectField
|
#from ajax_select.fields import AutoCompleteSelectMultipleField, AutoCompleteSelectField
|
||||||
|
|
||||||
|
class BaseGeoAdmin(admin.OSMGeoAdmin):
|
||||||
|
openlayers_url = 'http://openlayers.org/dev/OpenLayers.js'
|
||||||
|
openlayers_img_path = None
|
||||||
|
map_template = 'gis/admin/osm.html'
|
||||||
|
default_lon = 72.855211097628413
|
||||||
|
default_lat = 19.415775291486027
|
||||||
|
default_zoom = 4
|
||||||
|
|
||||||
|
|
||||||
class PlaceAdmin(admin.OSMGeoAdmin):
|
class OpenSpaceAdmin(BaseGeoAdmin):
|
||||||
# fields = ('preferred_name', 'feature_type', 'admin1', 'admin2', 'geometry', 'url', 'authority_record', 'time_frame', 'is_primary',)
|
# fields = ('preferred_name', 'feature_type', 'admin1', 'admin2', 'geometry', 'url', 'authority_record', 'time_frame', 'is_primary',)
|
||||||
search_fields = ['name', 'location']
|
search_fields = ['name', 'address']
|
||||||
# list_filter = ('feature_type',)
|
list_filter = ('ward', 'reservation', 'occupied',)
|
||||||
|
list_display = ('address', 'ward', 'reservation', 'occupied', 'cts', 'area',)
|
||||||
# inlines = [FeatureNamesInline]
|
# inlines = [FeatureNamesInline]
|
||||||
# list_display = ('__unicode__', 'feature_type_name', 'admin1', 'admin2', 'time_start', 'time_end',)
|
# list_display = ('__unicode__', 'feature_type_name', 'admin1', 'admin2', 'time_start', 'time_end',)
|
||||||
# list_per_page = 30
|
# list_per_page = 30
|
||||||
# list_filter = (FeatureTypeFilter,)
|
|
||||||
openlayers_url = 'http://openlayers.org/dev/OpenLayers.js'
|
|
||||||
openlayers_img_path = None
|
|
||||||
# form = featuresForm
|
# form = featuresForm
|
||||||
# readonly_fields = ['geometry']
|
# readonly_fields = ['geometry']
|
||||||
# map_template = 'gis/admin/osm.html'
|
# map_template = 'gis/admin/osm.html'
|
||||||
|
@ -25,5 +30,32 @@ class PlaceAdmin(admin.OSMGeoAdmin):
|
||||||
# default_zoom = 4
|
# default_zoom = 4
|
||||||
# extra_js = ['http://openstreetmap.org/openlayers/OpenStreetMap.js', 'http://openlayers.org/dev/OpenLayers.js']
|
# extra_js = ['http://openstreetmap.org/openlayers/OpenStreetMap.js', 'http://openlayers.org/dev/OpenLayers.js']
|
||||||
|
|
||||||
admin.site.register(Place, PlaceAdmin)
|
class DevelopmentAdmin(BaseGeoAdmin):
|
||||||
|
search_fields = ['name', 'address']
|
||||||
|
list_display = ('__unicode__', 'address', 'area', 'proposed_development_area', 'including_development_area',)
|
||||||
|
|
||||||
|
class AreaAdmin(BaseGeoAdmin):
|
||||||
|
search_fields = ['name', 'address']
|
||||||
|
list_display = ('__unicode__', 'address', 'area',)
|
||||||
|
|
||||||
|
class MillLandAdmin(BaseGeoAdmin):
|
||||||
|
search_fields = ['name', 'address', 'old_name', 'owner']
|
||||||
|
list_display = ('__unicode__', 'address', 'old_name', 'owner',)
|
||||||
|
list_filter = ('owner',)
|
||||||
|
|
||||||
|
class PedestrianAvenueAdmin(BaseGeoAdmin):
|
||||||
|
search_fields = ['name']
|
||||||
|
list_display = ('__unicode__', 'length',)
|
||||||
|
|
||||||
|
|
||||||
|
admin.site.register(OpenSpace, OpenSpaceAdmin)
|
||||||
|
admin.site.register(Forest, AreaAdmin)
|
||||||
|
admin.site.register(Fort, AreaAdmin)
|
||||||
|
admin.site.register(HillForest, AreaAdmin)
|
||||||
|
admin.site.register(Waterfront, AreaAdmin)
|
||||||
|
admin.site.register(River, DevelopmentAdmin)
|
||||||
|
admin.site.register(CreekWetland, DevelopmentAdmin)
|
||||||
|
admin.site.register(Nullah, DevelopmentAdmin)
|
||||||
|
admin.site.register(MillLand, MillLandAdmin)
|
||||||
|
admin.site.register(Beach, AreaAdmin)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ from decimal import Decimal
|
||||||
def do(filename):
|
def do(filename):
|
||||||
CsvFile = csv.reader(open(filename), delimiter="\t")
|
CsvFile = csv.reader(open(filename), delimiter="\t")
|
||||||
for row in CsvFile:
|
for row in CsvFile:
|
||||||
p = Place()
|
p = {}
|
||||||
p.ward = row[0].strip()
|
p.ward = row[0].strip()
|
||||||
p.reservation = row[1].strip()
|
p.reservation = row[1].strip()
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1,18 +1,90 @@
|
||||||
from base.models import BaseModel
|
from base.models import BaseModel
|
||||||
from django.contrib.gis.db import models
|
from django.contrib.gis.db import models
|
||||||
|
|
||||||
class Place(BaseModel):
|
class OpenSpace(BaseModel):
|
||||||
ward = models.CharField(max_length=4, blank=True)
|
ward = models.CharField(max_length=4, blank=True)
|
||||||
reservation = models.CharField(max_length=16, blank=True)
|
reservation = models.CharField(max_length=16, blank=True)
|
||||||
pk_serial = models.IntegerField(null=True, blank=True) #serial acc to PK Das excel sheets
|
pk_serial = models.IntegerField(null=True, blank=True) #serial acc to PK Das excel sheets
|
||||||
occupied = models.BooleanField(default=False)
|
occupied = models.BooleanField(default=False)
|
||||||
name = models.CharField(max_length=1024, blank=True)
|
name = models.CharField(max_length=1024, blank=True)
|
||||||
address = models.TextField()
|
address = models.TextField(blank=True)
|
||||||
cts = models.CharField(max_length=512, null=True, blank=True)
|
cts = models.CharField(max_length=512, null=True, blank=True)
|
||||||
area = models.DecimalField(max_digits=15, decimal_places=3)
|
area = models.DecimalField(max_digits=15, decimal_places=3)
|
||||||
geometry = models.GeometryField(null=True, blank=True)
|
geometry = models.GeometryField(null=True, blank=True)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return "%s %s %s" % (self.ward, self.reservation, self.name,)
|
return "%s %s %s" % (self.ward, self.reservation, self.address,)
|
||||||
|
|
||||||
|
class AreaModel(BaseModel):
|
||||||
|
pk_serial = models.IntegerField(null=True, blank=True)
|
||||||
|
name = models.CharField(max_length=1024, blank=True)
|
||||||
|
address = models.TextField(blank=True)
|
||||||
|
area = models.DecimalField(max_digits=15, decimal_places=3)
|
||||||
|
geometry = models.GeometryField(null=True, blank=True)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.address
|
||||||
|
|
||||||
|
|
||||||
|
class Forest(AreaModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Fort(AreaModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class HillForest(AreaModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Waterfront(AreaModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Beach(AreaModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class DevelopmentModel(BaseModel):
|
||||||
|
pk_serial = models.IntegerField(null=True, blank=True)
|
||||||
|
name = models.CharField(max_length=1024, blank=True)
|
||||||
|
address = models.TextField(blank=True)
|
||||||
|
area = models.DecimalField(max_digits=15, decimal_places=3)
|
||||||
|
proposed_development_area = models.DecimalField(max_digits=15, decimal_places=3)
|
||||||
|
including_development_area = models.DecimalField(max_digits=15, decimal_places=3)
|
||||||
|
geometry = models.GeometryField(null=True, blank=True)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return "%d: %s" % (self.pk_serial, self.name,)
|
||||||
|
|
||||||
|
|
||||||
|
class River(DevelopmentModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class CreekWetland(DevelopmentModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class WaterBody(DevelopmentModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Nullah(DevelopmentModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class MillLand(BaseModel):
|
||||||
|
pk_serial = models.IntegerField(null=True, blank=True)
|
||||||
|
name = models.CharField(max_length=1024, blank=True)
|
||||||
|
address = models.TextField(blank=True)
|
||||||
|
old_name = models.CharField(max_length=1024, blank=True)
|
||||||
|
owner = models.CharField(max_length=1024, blank=True)
|
||||||
|
geometry = models.GeometryField(null=True, blank=True)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
class PedestrianAvenue(BaseModel):
|
||||||
|
pk_serial = models.IntegerField(null=True, blank=True)
|
||||||
|
name = models.CharField(max_length=1024, blank=True)
|
||||||
|
length = models.DecimalField(max_digits=5, decimal_places=2)
|
||||||
|
geometry = models.LineStringField(null=True, blank=True)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user