-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
end simplify_network()
immediately if already meets criteria
#68
Comments
wrong. Topological correctness does not mean that there are no artifacts. There is nothing to do if the two data frames are equal and the artifacts dataframe is empty. |
So that would be here after the first loop is completed, correct? (if that |
When this condition is met, should it raise an error, or can we actually the input simplified enough and return? It seems like this could be true on both the first and second loops? |
We can't. Threshold detection occasionally fails in certain contexts due to the distribution of block shapes. It should raise as it does now. |
OK, I'm wondering if it would be prudent to cut a patch release of |
After that I can look back to try to determine better logic this. |
We'd need to backport that. But if you wait a bit, I think that Streetscape will be ready for 0.9. |
Yeah, I think this can surely wait. Just wanted to keep it on the radar. |
So I have been playing around with some ideas and thinking on this, and (unless I am missing something obvious) the logic gets a bit subjective. We may simply want to make it clear to the user that the algorithm we employ does not decide if a network dataset is "simplified enough" and the user themself needs to determine that. As a case in point, below is some code and plots of the original Apalachicola, FL testing data ( My goal with this was to find some simple & clear criterion for popping out of the process, but this is seems to be more difficult than I had imagined These are some relevant changes on the import geopandas, matplotlib.pyplot, sgeop
f = "sgeop/tests/data/apalachicola_original.parquet"
raw_original = geopandas.read_parquet(f, columns=["geometry"]).reset_index(drop=True)
iterations = 3
scene = "Simplification Iteration {}"
scenes = {scene.format(0): raw_original}
for i in range(iterations):
scenes[scene.format(i+1)] = sgeop.simplify_network(scenes[scene.format(i)].copy())
panels = [[scene.format(0), scene.format(1)], [scene.format(2), scene.format(3)]]
fig, axd = matplotlib.pyplot.subplot_mosaic(panels, figsize=(9, 9), layout="constrained")
for k, ax in axd.items():
scenes[k].plot(ax=ax)
ax.axis("off")
ax.set_title(k) Perhaps we should leave this issue open for now, but I'll not spend more time on it at this point. |
We need some logic to end
sgeop.simplify_network()
immediately if the input roads dataset already meets our simplififed criteria. This can be determined within the call tosgeop.nodes.fix_topology()
and simply return the result there.The check should be after
induce_nodes()
is called where we are checking ifroads
androads_w_nodes
are equivalent. If they are, no further simplification is needed, as far as I understand.Thoughts @martinfleis @anastassiavybornova ?
The text was updated successfully, but these errors were encountered: