Tuesday 30 October 2018

attribute joins - Joining CSV to KML/GeoJSON in Leaflet webmap and showing joined data in popups?


I'm trying to create a Leaflet/Mapbox webmap with line layer (GeoJSON or KML) with some IDs and data coming from the .csv (after joining through this ID) file located on the same path as the index.html. Joined attributes need to show on lines popup windows.


I've found THIS article with exactly the same assumptions as mine:



  • Store the attributes of a GeoJSON in a CSV file

  • Allow a non-GIS user to edit a cloud-hosted CSV file which then updates a webmap

  • Have the web map be a static app with no GIS/PostGIS/SQL etc server involved


  • Load a CSV (from say Dropbox) and a GeoJSON stored on the web server

  • Join the CSV to the GeoJSON file using JavaScript

  • Style the polygons using the field added from the CSV


But honestly I've fallen during recreation this example for my needs. It seems to be more complicated than just joining the .csv with lines.


Here is my zipped example website (clean, without any joining implemented, just .csv and kml variables)


The working example of map from mentioned article is HERE.


My clean code (with no joining yet) looks like this:


    




Projekty Budżetu Partycypacyjnego Dzielnicy Bielany


























Join method from other article is described here: Joining CSV to GeoJSON in Leaflet?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...