0

I know my question might sound a bit too general but I actually just need some guidance to start learning geographical plotting with Plotly package iin python.
I'm following guides on the internet but I never really manage to replicate the method with data I find on the internet.
The simple case I'm trying to plot is the following:

  • I have a Geopandas dataframe gdf with coordinates of point samples and a value, all measured in a particular European state (Netherlands in my case).
  • I found on the internet a shape of the state in json (link to json)

What I am trying to do is:

  1. Plotting a blank choropleth map of the Netherlands, so that it would set the correct position for points of the dataframe
  2. On top of the previous layer, I want to plot the points of my gdf

I'm not asking for code so I won't be posting the gdf.
What I really want to understand is

  1. Is this (px.choropleth overlayed with px.scatter_geo) the best way to plot points on a conventional geographical area?
  2. What are the features that need to be present on my gdf in order to make this work? For now it has a 'geometry' column and a 'value' column.

Also feel free to post any additional resource that might prove helpful to start learning this topic (as long they explain every step and don't assume familiarity with geodata structure).

StackyGuy
  • 37
  • 7
  • Have you looked at the example files for the documentation on Github? https://github.com/geopandas/geopandas/tree/main/doc/source/gallery – Dan Nagle Nov 18 '22 at 11:47
  • Yes actually, but I'm looking for a way to do that kind of plotting using the Plotly package and not the geopandas methods (that I agree are easier to use, but i want to learn Plotly) – StackyGuy Nov 18 '22 at 11:54
  • 1
    I generally prefer `px.scatter_mapbox` then you don't need to consider having a base layer that shows netherlands. using `px.scatter_geo` on top of a choropleth is simple too. can code up pretty quickly – Rob Raymond Nov 18 '22 at 12:16
  • This is definitely a valid alternative. I just used the function and i can say it is very intuitive and graphically pleasant. – StackyGuy Nov 18 '22 at 14:44

0 Answers0