Comments (6)
Mobile app don't need geojson, it overhead requirements. We need very small part of information.
Backend don't need geojson. geojson required by javascript lib to draw map.
We can generate this format dynamicly, and provide it to lib. But it's incorrect to think that we need this file and should keep it on client and server parts.
from corruption_tracker.
@Vegasq agree with you. Lets implement your step-by-step plan
In this case, we need two more models:
class Layer :
"""this could be set of polygons of organizations for district, or polygons of districts from whole sity view, or polygons of cities from whole country view""
- name
- type (choicefield - organization/district/county
class Polygon:
- organization (one-to-one-field to Organization model , null=True)
- layer (FK to Layer)
- coordinates
All aditional info would be stored in Organization model
Also leaflet.js provides functionality to draw polygons, this could be included to django admin using django-leaflet package - https://github.com/makinacorpus/django-leaflet#leaflet-map-forms-widgets
and could be tested here http://umap.openstreetmap.fr/en/ by clicking 'create a map'
GeoJSON could be used as fixture, as alternative way to get some polygons into DB
from corruption_tracker.
At all, transition from upper Layer to lower could be done in such way:
User click on polygon of county, js send to server request with polygon/layer id, server agregates polygons of lower level Layer and return them as json to js. Js reload map, make zoom in and draw polygons from gotten json. Same to go down to organizations level
If it is right way, Layers have to be ordered hierarchically. By using FK to self, maybe
from corruption_tracker.
Also leaflet.js provides functionality to draw polygons, this could be included to django admin using django-leaflet package - https://github.com/makinacorpus/django-leaflet#leaflet-map-forms-widgets
Lets postpone it. If we want to use their native tools, we will have two new binary requirements.
- GEOS binary package to work with geo data.
- PostreSQL to use it with django.contrib.gis.db.backends.postgis
I think we can handle it, but in different patchset, and after discrussion about new requirements.
from corruption_tracker.
Looks like we'll stay with GeoJSON file for a while, and it have to contain:
at top-level:
- layer_id (Kharkiv, Lviv, Ukraine, Saltovka)
- layer_type (organizations, districts)
- set_default(1,0) - if we'll need to load pack of geojsons, one of them must be marked as primary
at polygon-level:
- organization_type (based on OrganizationType.ORG_TYPES
https://github.com/autogestion/corruption_tracker/blob/master/claim/models.py#L14 ) - organization_name
- coordinates
This values would be parsed by initiate_db comand (
https://github.com/autogestion/corruption_tracker/blob/master/claim/management/commands/initiate_db.py and stored to database
from corruption_tracker.
All data is stored in Postgres
from corruption_tracker.
Related Issues (15)
- E-mail auto sending. HOT 4
- Review process
- Use ctracker to track violations on local elections HOT 2
- Bug reports
- Way to prevent abuse HOT 1
- Add to Claim type of violation
- Implement internationalization EN|UA|RU
- Polygon vs Organization issue
- Connecting social account to a local account HOT 3
- Statistical data representation and export HOT 3
- Implement API for mobile app HOT 6
- Angular JS on Frontend
- Realtime map with Tornado
- Implement crowdsourcing tool to add polygons by volunteers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corruption_tracker.