Skip to content
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

Added tutorial for Delaunay triangulation #67

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

inomag
Copy link

@inomag inomag commented Apr 13, 2022

Added a tutorial for delaunay triangulation and generating voronoi frames using PySAL library. I had earlier proposed creating notebooks for all algorithms mentioned in Geo spatial Examples in Gallery section. Therefore, submitting this notebook for any suggestions and corrections.

Video Link

@rossbar @MridulS @dschult

@MridulS
Copy link
Member

MridulS commented Apr 14, 2022

@inomag can you remove the Code of conduct from this PR?

@MridulS
Copy link
Member

MridulS commented Apr 14, 2022

You also need to install rtree to use voronoi_frames.

@inomag
Copy link
Author

inomag commented Apr 14, 2022

@MridulS Thanks. On it.

@MridulS
Copy link
Member

MridulS commented Apr 14, 2022

I cancelled the checks as it looks like there are some dependencies not available as a wheel and github actions were trying to compile and build them. But you can look at the output https://output.circle-artifacts.com/output/job/2ce60e89-c068-41aa-902e-6f19ac0ce7b4/artifacts/0/site/_build/html/content/geospatial/delaunay/index.html

@rossbar
Copy link
Contributor

rossbar commented Apr 14, 2022

I cancelled the checks as it looks like there are some dependencies not available as a wheel and github actions were trying to compile and build them.

Thanks @MridulS - I think we should take a closer look at the dependencies because IME depending on unsupported/poorly maintained dependencies for tutorials is a real nightmare. I haven't had time to look into the details, but in this case is there a reason not to use scipy.spatial for the Delaunay/voronoi functionality?

@MridulS
Copy link
Member

MridulS commented Apr 14, 2022

Yeah we should try not to depend on so many things in this repo. There is something GDAL like hanging around in the GitHub actions logs and well I want to be sane right now so will have a look later 😅

@inomag
Copy link
Author

inomag commented Apr 14, 2022

Yes @rossbar, using scipy.spatial was also an option. There was no reason other than that Delaunay triangulation was implemented on the Networkx website using PySAL. Should I change it to scipy.spatial instead?

@rossbar
Copy link
Contributor

rossbar commented Apr 15, 2022

There was no reason other than that Delaunay triangulation was implemented on the Networkx website using PySAL.

Of course, sorry for the silly question. Generally I would prefer scipy over other libraries, but if the whole point of the example is to demonstrate pysal then that sort of defeats the purpose. I'm not familiar enough with the geospatial packages to have an opinion. On the one hand we want to showcase the use of NetworkX for geospatial data, but on the other hand it gets tricky when there are multiple ways to accomplish the same thing with different tradeoffs/dependencies.

@inomag
Copy link
Author

inomag commented Apr 15, 2022

Also, regarding the unsuccessful builds, do you have any suggestions what changes should I make?

@rossbar
Copy link
Contributor

rossbar commented Apr 15, 2022

Also, regarding the unsuccessful builds, do you have any suggestions what changes should I make?

There's nothing to be done in the short term - the builds are failing because some of the dependencies (I didn't bother to check which exactly) don't provide wheels for Python 3.10. This means that to use those libraries, they have to be build from source in CI, which may a) require additional custom setup in the CI scripts and b) take a long time. In a perfect world, we would limit dependencies to those that are reliably maintained and provide wheels for the latest Python on all major platforms. We'll need to have a larger discussion at some point about the maintainability of the examples.

@inomag
Copy link
Author

inomag commented Apr 15, 2022

Ok thanks. For now, build is successful. Also, I am interested in applying for GSOC in Pedagogical Notebooks project. If possible, I would also like to work and resolve the build and dependencies issues. Should I mention that in my proposal?

@MridulS
Copy link
Member

MridulS commented Apr 18, 2022

If possible, I would also like to work and resolve the build and dependencies issues. Should I mention that in my proposal?

Feel free to mention that :) but these aren't necessarily a technical problem. It's more about creating policies around when and where to stop adding more dependencies!

@inomag
Copy link
Author

inomag commented Apr 18, 2022

Yes, its not an issue. Instead, we need to check the dependencies we are about to include in the requirements. Though I have mentioned it in my proposal, its more of a sleuthing task while creating the notebook.


### Voronoi Frames with Real World Dataset

This example shows how to build a delaunay graph (plus its dual, the set of Voronoi polygons) from a set of points. For this, we will use the dataset of train stations in Singapore. The methods shown here can also work directly with polygonal data using their centroids as representative points.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@inomag where is this dataset from? Can you add a link?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants