I'm having trouble whether which approach to take in simplifying a graph from another graph. It's not a basic graph difference but the other way around.

I want to further simplify a graph of a street network Graph (G) by only getting the nodes and edges where a geojson linestring passes by. I want my final output to be of course a graph.

Is it a correct approach for geojson linestring to:

1.) Turn geojson (linestring) into Shapely geometry object,

2.) Project it to a GeoDataFrame

3.) >>> ???

or is it possible and should I turn a graph into a shapely object? Not all geojson linestring passes exactly on the street network, so I was thinking that I should be able to compute that a linestring is near the original Graph (G) and take Graph(G)'s nodes and edges of the filtered (where the linestring passes by) rill be retained.

  • 1
    "compute that a linestring is near the original graph" to me this sounds like an example where you would probably want to create an RTree object from your original graph, and then using RTree search you'll extract some sub-parts of your original graph, depending on where each point of your linestring is
    – DenisFLASH
    Dec 8, 2017 at 15:29
  • @DenisFLASH I could try this. Seems a better starting point
    – Reiion
    Dec 9, 2017 at 12:14


Your Answer

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

Browse other questions tagged or ask your own question.