cccs-web / soc-maps

Web mapping application in support of social analysis.
6 stars 5 forks source link

determine appropriate web mapping application architecture #1

Open cccs-ip opened 10 years ago

cccs-ip commented 10 years ago

his discussion is carried over from cccs-web/core issue 114.

CCCS is looking to build a web mapping application that affords users some relative autonomy in terms of adding and manipulating shapefiles (to occur from time to time, as new data becomes available) and to tweak the way those shapefiles are associated to different datasets (to be updated regularly) to help users visualize information.

CCCS' basic needs with respect to the operation of the web map application are:

  1. integrate with our current Django web environment
  2. allow reproducible installation for anyone cloning our repos with limited knowledge of code [clear documentation]
  3. load quickly on client browsers
  4. allow shapefiles to be easily loaded into map application
    • if we will be working in postgres and wish to use the database to serve the files, we'd also like to supply some instructions and reference guides for how to manage tables within postgres
  5. extensible to allow 'admins' to manipulate layer views from the front end:
    • shapefile color
    • shapefile transparency
    • layer order
  6. capability to manage files
    • group files into directories (helpful to toggle on- and off-views for multiple files)
  7. capability to support analysis
    • calculate distances from and between points
    • capability to visualize distances (such as creating a circulate around to point to extend a certain distance, or creating a fixed line element of a specific length that can be moved and rotated like a 'measuring stick)
    • facilitate custom queries such as "how far away from that airport is this house" or " show rings indicating distances at intervals of 10 meters from point, extending out 50 meters)

Existing software as a point of departure:

We may be able to learn and integrate elements from other applications. One bit of software that appears to be based on an software architecture similar to ideas CCCS has been kicking around is Marine Map.

MarineMap Demo:
* http://southcoast.marinemap.org/marinemap/
MarineMap Source Code:
* https://code.google.com/p/marinemap/

Initial Responses to Kartoza-proposed setup

Tim's proposal for file management architecture helps to explain how things work on the back end, but I still have a few questions about how we're connecting the front end. The README file suggests that we need to install and configure QGIS server, and that we'll be creating different qgis project files for the various maps we wish to publish. Is this correct? How will we connect it to our Django web applications? Will we be using Tim's QGIS-Django?

On a somewhat related point to data system architecture:

It looks to me that Tim's diagram suggests that CCCS data and our client project data will share the same repositories. This is not the case. CCCS client projects are essentailly idependent from the CCCS website. With the GitHub cccs-web/core repository houses the master version of the web application used by CCCS and all our client sites, each of these sites runs from an independent branch and uses a separate database. Hence, they should be considered equivalent and parallel sites (rather than dependent):

cccs-web/core/ client website app (cloned from cccs-web/core/)
custom mezzanine app
soc-maps app
custom mezzanine app client soc-maps app (cloned from cccs-web/soc-maps/)
other client-specific application
cccs database
client database

This also carries the implications for our development workflow. CCCS will remain public, but any client site we create must be private. We can discuss specific issues and work requests on the private client sites, and as we develop tools of refine 'how to' discussions, we can move these back into the public CCCS website. To the greatest extent possible, my goal is to host most of the development and 'how to' discussions on the CCCS GitHub account, so that it remains in the public domain.

timlinux commented 10 years ago

Just a quick take on your requirements matrix:

Requirement Can do? Platform
Integrate with our current Django web environment Yes Leaflet / OL3
Allow reproducible installation for anyone cloning our repos with limited knowledge of code Yes primarily through ready to run docker containers and some help docs.
Load quickly on client browsers Yes Mapproxy - we would need to pretile / cache maps
Allow shapefiles to be easily loaded into map application Yes Using GeoNode might be better for this requirement. Otherwise we can write a shp importer for django (based on prior code of ours
PostgreSQL administration needs to be documente Yes Github wiki
Layer color Yes SLD (Geonode) or QML (QGIS)
Layer transparency Yes SLD (Geonode) or QML (QGIS)
Layer order Yes We would need to use a thicker client e.g. QGIS Web client or add some JS to OL3 / Leaflet to let user drag and drop layer order then generate a fresh request (but that will kille tilecachability)
Capability to manage files Yes Again GeoNode might be better on this
Group files into directories (helpful to toggle on- and off-views for multiple files) Yes Via QGIS projects
Capability to support analysis Yes Custom QGIS filters / Query views and WPS are options
Calculate distances from and between points Yes WPS + Javascript
Capability to visualize distances (such as creating a circulate around to point to extend a certain distance, or creating a fixed line element of a specific length that can be moved and rotated like a 'measuring stick) Yes WPS + Javascript
Facilitate custom queries such as "how far away from that airport is this house" or " show rings indicating distances at intervals of 10 meters from point, extending out 50 meters) Yes WPS + Javascript
timlinux commented 10 years ago

From the list of requirements you have I think we need to look at maybe a hybrid solution e.g. using GeoNode for user uploaded layers which will be sortable etc. and then using QGIS for the basemap which will be precached and not sortable etc. Of course that depends on how flexible we need to be with the base mapping layers.

cccs-ip commented 10 years ago

Is it possible for QGIS map (qgis file) to be served within an HTML frame? Or are our only options OpenLayers and/or Leaflet? [with regard to the first requirement]

gubuntu commented 10 years ago

The QGIS 'map' as published via QGIS server is merely a collection of WMS layers. Layers, Groups or the whole project can be referenced by http GET or POST WMS GetMap requests. e.g. this fetches a single map tile:

http://map1.tracks4africa.net/cgi-bin/mapserv?map=T4A_DHL&LAYERS=africa_as_one&TRANSPARENT=true&FORMAT=image%2Fpng&REPROJECT=true&ISBASELAYER=false&VISIBILITY=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=1836214.5133937,-4061164.1260133,3695163.0409562,-2960470.9189039&WIDTH=760&HEIGHT=450

So if you can construct a valid WMS request you'll get an image. Anything fancier like overlaying or interaction - that's what Leaflet and OL are for.

cccs-ip commented 10 years ago

Thanks for the clarification, Gavin. This list looks good. I read about GeoNode and am really impressed. I'd be glad to move forward.

We can keep with Docker, as you suggest. I would be happy to get a bit more insight into the comparative strengths and weaknesses of the application, per my questions on issue #5 .