Geographic Information Systems Asked on April 7, 2021
I’m calculating areas of a KML in QGIS, ArcGIS and GeoPandas and all of then are different, my results are this:
Geopandas | ArcGIS | QGIS |
---|---|---|
29.3498 | 28.500084 | 25,651554 |
The original crs of the KML is 4326, so in QGIS and ArcGIS first, I reproject the KML (in ArcGIS first I have to make the KML a shp or feature) and then I calculate the area.
I checked this post about the same problem but with QGIS, and I calculate the area in QGIS like they said, in ArcGIS I did something similar, first I set the coordinate system to the dataframe and then re calculate the area, with GeoPandas I´m doing this:
import geopandas as gpd
import fiona
gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'
df = gpd.read_file('original_kml.kml', driver='KML')
gdf = df.to_crs('esri:102015')
gdf["area"] = gdf['geometry'].area/ 10**6
gdf.sum()
Just in case someone wants to check the process the files are here
In GeoPandas, you transform the geographic coordinate system of shapefile into a conformal projected one (angle-preserving, which means it doesn't preserve areas). It is expected to get different area values. In fact, in this case, if you had the same value in GeoPandas, then something would be wrong.
When it comes to QGIS vs ArcGIS, there are many invalid geometries in your data. If you apply Dissolve tool in QGIS you will see that. (My presume) ArcGIS and QGIS may be handling the invalid geometries differently or they are doing something we are not aware of or something else.
My suggestion:
gdf
using gdf.to_file("new_file_path")
.This is what I've got:
Geopandas: 29.3497 km²
ArcGIS : 29.349727079406 km²
QGIS : 29.349727432 km²
This answer doesn't explain perfectly why the areas are different. At least, you get rid of different areas issue.
Correct answer by Kadir Şahbaz on April 7, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP