Python Forum

Full Version: Plotting boxed coordinates over a map
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a dataframe that has 8 coordinates representing a boxed area on the surface of Mars. I would like to pick a row from my dataframe and represent it graphically as an area plotted over the backdrop of an image of the surface of Mars zoomed in to just the required place. An example of the data is below which uses aerocentric latitude and an east positive longitude I think it was which goes up to 360 from the central point. I know there are already websites which do this but i want to do it myself using my own database (and i can then compare my results with the existing websites for checking purposes).

UPPER_LEFT_LONGITUDE 347.15
UPPER_LEFT_LATITUDE -36.545832
UPPER_RIGHT_LONGITUDE 347.69
UPPER_RIGHT_LATITUDE -36.486035
LOWER_LEFT_LONGITUDE 347.81
LOWER_LEFT_LATITUDE -40.795116
LOWER_RIGHT_LONGITUDE 348.38
LOWER_RIGHT_LATITUDE -40.735216

I am not aware of how python can be used to plot shapes from dataframe data or how to overlay them over a map.

Any help would be appreciated.
It all depends on what you are using for your map.
On Earth an excellent option is folium. I do not know how you could apply that to Mars.

Best idea I have is that you have the map of Mars as an image and plot with the image as the background.

See Plot using matplotlib on an image
(Aug-31-2021, 01:52 PM)jefsummers Wrote: [ -> ]It all depends on what you are using for your map.
On Earth an excellent option is folium. I do not know how you could apply that to Mars.

Best idea I have is that you have the map of Mars as an image and plot with the image as the background.

See Plot using matplotlib on an image

Hi I still need to acquire one but at the moment its not relevant. First step is to be able to plot the dataframe points as a rectangle type shape on the correct grid. I will check the article you linked to. The grid will be +- 90 i think up and down and 0 to 360 from centre point eastwards so i guess maybe best way to plot is to have +-90 y axis and -180 to +180 x axis and do a convert on x axis points. The centre point of map would be 0,0.
Matplotlib is a great resource for plotting. Highly recommended. Seaborn is also good, I just don't like that the author will not release source.