Reputation: 31
I am interested in having my Shapely polygon understand the crossover from a longitude of 179 degrees to -179 degrees. As can be seen with the plot below, this Polygon is understandably viewed as spanning from -179 to +179. Is there anyway around this (to get it to view it as spanning from +179 to -179 and thus having an area of 2? Thank you!
import geopandas
from shapely.geometry import Polygon
p = Polygon([[179,5],[179,6],[-179,6],[-179,5],[179,5]])
p_gs = geopandas.GeoSeries(p,crs= "EPSG:4326")
p_gs.plot()
Upvotes: 0
Views: 1182
Reputation: 243
I see what you mean. But a map is not a globe. (After opening the OSM map in QGIS, etc., keep moving to the right. There is only a blank space.)
epsg 4326 i.e. the longitude and latitude coordinate system ends at 180 on both sides. It represents only 180 from the reference point. Therefore, to do the work you want, you need to select a coordinate system that can represent the part and then draw again.
Choose a coordinate system that allows for meter-based calculations(area or Euclidean distances must use the TM coordinate system) and the reference point represents the desired area.
After that, it seems to be necessary to draw a picture by changing the longitude and latitude to the coordinates that fit the CRS.
Upvotes: 0