Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render resource geojson data #122

Closed
21 of 23 tasks
rufuspollock opened this issue Mar 6, 2017 · 3 comments
Closed
21 of 23 tasks

Render resource geojson data #122

rufuspollock opened this issue Mar 6, 2017 · 3 comments

Comments

@rufuspollock
Copy link
Member

rufuspollock commented Mar 6, 2017

When we get a resource with geojson data we should render it as a simple map rather than a table.

Some examples:

http://data.okfn.org/data/core/geo-admin1-us
http://data.okfn.org/data/core/geo-nuts-administrative-boundaries

Tasks

Research:

  • Clarify what type of data we want to render
    • only point and Multi Polygon?
  • Explore which library we have to use
    • Is plotly good enough ?
    • What are the other options?
  • Come up with recommendation on what we use.
  • Explore How the old code in data.okfn.org has been implemented
    • Answer: backend checks if geojson uses reclinejs

Implementation:

Acceptance Criteria

  • A resource with geojson data renders properly in data package details page.
  • A resource with topojson data renders properly (optional - only do if easy)

Research

Requirements

We want to render geojson data in the data package view page.

Reference: http://frictionlessdata.io/guides/publish/geo/

What I got from above reference is that we mainly support

  • Multi Polygon
  • Point

It can be mix and match of both.

Explore which library we have to use

Is plotly good enough?

We have plotly in our dependency list already. So it would be great if we can use it for geo json render also.

In plotly.js we have some support for Multi Polygon but not points and polygon etc. Here are two issues in plotly:

In summary:

  • Plotly does not support GeoJson directly
  • mix and match of Multi Polygon and point is not possible
  • City level plotting is not possible

What are the other options?

leafletjs is really good choice as it directly support geojson. It has support for:

  • Point
  • Line String
  • Polygon
  • Multi Point
  • Multi Line String
  • Multi Polygon
  • Geometry Collection.

And we can mix and match all types of data.

Come up with recommendation on what we use

Clearly leafletjs is winner between the two

@subhankarb
Copy link
Contributor

subhankarb commented Mar 8, 2017

Updated the summary with the results of research: we should use leaflet.

Next step is to plan implementation of leaflet

subhankarb pushed a commit to subhankarb/dpr-js that referenced this issue Mar 9, 2017
We want to render geojson data as a simple map rather than a table.

  * Modified fetchDataPackageAndData to handle geojson type data
    * Have to get data by fetch as datapackage-test gets table data only
  * Added LeafletMap component render in index.jsx
  * Added leaflet css in index.html
  * Added leaflet dependency
  * Added fixer data for geojson

Ref - datopian#122
subhankarb pushed a commit to subhankarb/dpr-js that referenced this issue Mar 9, 2017
We want to render geojson data as a simple map rather than a table.

  * Modified fetchDataPackageAndData to handle geojson type data
    * Have to get data by fetch as datapackage-test gets table data only
  * Added LeafletMap component render in index.jsx
  * Added leaflet css in index.html
  * Added leaflet dependency
  * Added fixer data for geojson

Ref - datopian#122
subhankarb pushed a commit to subhankarb/dpr-js that referenced this issue Mar 9, 2017
We want to render geojson data as a simple map rather than a table.

  * Modified fetchDataPackageAndData to handle geojson type data
    * Have to get data by fetch as datapackage-test gets table data only
  * Added LeafletMap component render in index.jsx
  * Added leaflet css in index.html
  * Added leaflet dependency
  * Added fixer data for geojson

Ref - datopian#122
subhankarb pushed a commit to subhankarb/dpr-js that referenced this issue Mar 9, 2017
subhankarb pushed a commit to subhankarb/dpr-js that referenced this issue Mar 9, 2017
subhankarb pushed a commit to openknowledge-archive/dpr-api that referenced this issue Mar 10, 2017
@subhankarb
Copy link
Contributor

FIXED.
We can check it on https://staging.datapackaged.com/core/ex-geojson

@rufuspollock
Copy link
Member Author

FIXED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants