1

Basically I was going through this tutorial where we did import data from OSM and throughout modifying the data, There was basically a command to add missing Highway speed limits to Unclassified Roads.

Here's the tutorial and while recreating the GeoDataFrame dataset by combining the two frames using this command.

edges = edges_with_maxspeed.append(edges_without_maxspeed)
edges["maxspeed"].unique()

I got this:

ValueError: Cannot determine common CRS for concatenation inputs, got ['WGS 84']. Use `to_crs()` to transform geometries to the same CRS before merging.

Knowing as I mentioned above both datasets share the same CRS.

I tried this:

edges_with_maxspeed = edges_with_maxspeed.reset_index(drop=True)
edges_without_maxspeed = edges_without_maxspeed.reset_index(drop=True)
edges = edges.reset_index(drop=True)
edges = gpd.GeoDataFrame(pd.concat([edges_without_maxspeed, edges_with_maxspeed], ignore_index=True), crs=edges.crs)

and multiple other lines but couldn't figure out the issue.

Marcelo Paco
  • 2,732
  • 4
  • 9
  • 26
kaydubz
  • 11
  • 3

1 Answers1

0

It seems like one of the dataframes doesn't have a crs. I'd first check which of the dataframes doesn't have a crs by doing:

print(edges_without_maxspeed.crs)
print(edges_with_maxspeed.crs)

Then, depending which one doesn't have a crs, you can set the crs of one to the other:

edges_without_maxspeed.crs = edges_with_maxspeed.crs

or...

edges_with_maxspeed.crs = edges_without_maxspeed.crs
Pieter
  • 340
  • 1
  • 6