SiLeBAT / fcl-client

Web app for analyzing food delivery networks
https://silebat.github.io/fcl-client/
GNU General Public License v3.0
7 stars 2 forks source link

GIS: Geojson is not displayed #425

Closed afalenski closed 2 years ago

afalenski commented 4 years ago

As a user who has uploaded *.geojson files I would like to see this shapefile. I uploaded a file containing all German municipalities (see http://opendatalab.de/projects/geojson-utilities/) as well as my own geojson drawn at https://geojson.io (see attachment). Neither of these geojson files were displayed.

Polygon-DE-0-rough.txt (rename .txt to .geojson; geojson is not allowed in ZenHub)

Include a warning -> if no projection type is given, the warning should be "Projection type of geojson file not specified. Mercator projection is assumed. Map might be distorted if data do not fit Mercator projection." -> if wrong projection type, the warning should be "Incorrect projection type. Incorrect geojson files are not supported."

Think of Tests

Additional context

General Guidelines

ruegenbfr commented 3 years ago

A solution has to deal with 2 aspects:

  1. The geojson is using some projection. Can the projection type be used?
  2. Provided the geojson contains an appropriate projection. Can the shapes be seen by user?

To 1.: We are using the openlayer library to visualize maps and shape files. This lib has an build in support for the the projection types 'EPSG:4326' and 'EPSG:3857' and some aliases of them. The lib provides a method to detect whether the projection is built in supported. Ergo, question 1 is easy to answer, if we want to use the built in support only.

To 2.: Event with an appropriate projection type, the user might see no shapes, either because (Case A) the dimension of the shapes is zero (only point of interests), or (Case B) the shapes are to small in comparison to the zoom scale or station distances, or (Case C) the shapes are out of focus (e.g. only german stations but a shape file from spain). Case A ist easy to detect, but Case B and C depend on some defintions, in particular 'When exactly are the shapes out of focus?' and 'When are the shapes to small?'

afalenski commented 3 years ago

1) We should definitely use both EPSG which are WGS 84 Web Mercator / WGS 84/Pseudo-Mercator. This "...is a variant of the Mercator map projection and is the de facto standard for Web mapping applications." (https://en.wikipedia.org/wiki/Web_Mercator_projection). 2) The user needs to use one of these two projections. An imported shape must be visible, even if it is just a point of interest. Using the zoom all button in FCL Web the shapes should also be focused. This means if there are 4 stations in Germany and one shape in the USA, the zoom all button should focus the map so that stations AND shape are visible.

afalenski commented 3 years ago

@ruegenbfr Please provide your geojson test file for testing when the 'EPSG:4326' and 'EPSG:3857' projection types have been implemented.

ruegenbfr commented 2 years ago

Warnings are different to the issue description:

Please test with: Polygon_DE_EPSG3043.geojson Polygon_DE_EPSG4326.geojson Polygon_DE_EPSG3857.geojson Polygon_DE_wo_projection_type_spec.geojson

afalenski commented 2 years ago

OS: Windows 10

Datasets:

Browsers: