Coder Social home page Coder Social logo

Comments (6)

Vegasq avatar Vegasq commented on July 21, 2024

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.

blank flowchart - new page

from corruption_tracker.

autogestion avatar autogestion commented on July 21, 2024

@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.

autogestion avatar autogestion commented on July 21, 2024

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.

Vegasq avatar Vegasq commented on July 21, 2024

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.

autogestion avatar autogestion commented on July 21, 2024

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:

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.

autogestion avatar autogestion commented on July 21, 2024

All data is stored in Postgres

from corruption_tracker.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.