1

I'm trying to create a large buffer (10,000km) around a specific point using Geopandas but the resulting shape is incorrect. I've changed the crs of the geodataframe to a projected crs (epsg:4087, World Equidistant Cylindrical, meters) before calculating the buffer, but the result is still not right. Here's the code:

import pandas as pd
import numpy as np
import geopandas as gpd

# This is the point around which I want to generate the buffer
pyongyang = pd.DataFrame({'city': ['Pyongyang'], 'country': ["Democratic People's Republic of Korea"], 'longitude': [125.7552106631059], 'latitude': [39.038430756002995]})

# Create the GeoDataFrame
pyongyangGeo = gpd.GeoDataFrame(pyongyang, geometry=gpd.points_from_xy(pyongyang.longitude, pyongyang.latitude), crs='epsg:4326')

# Change the crs to a projected crs in meters
pyongyangGeo = pyongyangGeo.to_crs('epsg:4087')

# Calculate the buffer (10,000km)
maxReach = pyongyangGeo.buffer(10000000)

# Create GeoDataFrame with the buffer
maxReachGeo = gpd.GeoDataFrame(pyongyang, geometry=maxReach, crs='epsg:4087')

# Change the crs for the buffer to WGS 84 to visualize it
maxReachGeo = maxReachGeo.to_crs('epsg:4326')

# Plot it
maxReachGeo.plot()

And this is the resulting plot:

enter image description here

As you can see there, the buffer seems to wrap around itself and remove the overlapping portions.

1
  • 1
    You probably want to use a projection centred on or near N. Korea, other wise you run in to edge effects when your buffer falls of the edge of the world
    – Ian Turton
    Commented Jun 21, 2021 at 16:02

1 Answer 1

1

As answered above in the comments, the problem was in the projection. After choosing a projection centered near North Korea (epsg:5179) the buffer works well.

3
  • It's not important, but I want to make a small correction. The coordinate system close to North Korea is correct, but it is precisely one of the official coordinate systems of South Korea. epsg.io/5179
    – Urban87
    Commented Jun 29, 2021 at 7:33
  • Yes, that's right. I couldn't find any "official" CRS for North Korea. Do you know any? Commented Jun 29, 2021 at 13:26
  • Well, there doesn't seem to be anything clearly stated. There have been studies on the coordinate system integrated in South Korea, but there is no official CRS. The North Korean satellite image-based data constructed by South Korea uses epsg 5186. This is the official coordinate system of the National Geographic Institute of South Korea.
    – Urban87
    Commented Jun 30, 2021 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.