Skip to content

Add Heatmap layer#384

Merged
martinRenou merged 25 commits intogeojupyter:mainfrom
gjmooney:heatmap_layer
Jan 27, 2025
Merged

Add Heatmap layer#384
martinRenou merged 25 commits intogeojupyter:mainfrom
gjmooney:heatmap_layer

Conversation

@gjmooney
Copy link
Collaborator

@gjmooney gjmooney commented Jan 22, 2025

Description

Adds heatmap layers

heatmap

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--384.org.readthedocs.build/en/384/
💡 JupyterLite preview: https://jupytergis--384.org.readthedocs.build/en/384/lite

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch gjmooney/jupytergis/heatmap_layer

@mfisher87
Copy link
Member

In QGIS, heatmaps are a rendering option for vector data. What do you think of implementing it that way in JGIS? That way, the user could switch the same data layer between heatmap, point clustering, and simple rules, for example.

The rendering mode abstraction could be applied for other cases as well. Hillshade is a rendering option for single band raster data in QGIS.

@gjmooney
Copy link
Collaborator Author

In QGIS, heatmaps are a rendering option for vector data. What do you think of implementing it that way in JGIS? That way, the user could switch the same data layer between heatmap, point clustering, and simple rules, for example.

The rendering mode abstraction could be applied for other cases as well. Hillshade is a rendering option for single band raster data in QGIS.

Yea, we should be able to implement that, we'll need to delete and recreate the layer when switching it to a heatmap or vice-versa so we may as well keep the option of adding a heatmap layer directly as well.

@gjmooney gjmooney added the enhancement New feature or request label Jan 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 24, 2025

Integration tests report: appsharing.space

@gjmooney gjmooney marked this pull request as ready for review January 24, 2025 13:49
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Thanks a lot @gjmooney ! That looks neat.

  • Would you be able to add a test cell in the Notebook that makes sure the Python API does work on the long run?
  • I guess we need to allow import/export of QGIS heatmap layers? Did you match the schema to something relatable of the QGIS format? If so, we can merge and tackle import/export in a separate PR

createLayer: true,
createSource: false,
layerData: { name: 'Custom Heatmap Layer' },
sourceType: 'GeoJSONSource',
Copy link
Member

Choose a reason for hiding this comment

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

Is it the only possible source type?

I'm only asking because I'm curious, allowing the form to create multiple source types is another task on itself (also not sure we want to allow it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is it the only possible source type?

I think it should work with any vector source that uses points.

@gjmooney
Copy link
Collaborator Author

* Would you be able to add a test cell in the Notebook that makes sure the Python API does work on the long run?

👍

* I guess we need to allow import/export of QGIS heatmap layers? Did you match the schema to something relatable of the QGIS format? If so, we can merge and tackle import/export in a separate PR

QGIS uses a Heatmap renderer on vector layers, which we currently don't export (@arjxn-py is working on that in #390). For importing form QGIS, it looks like the only attribute OL has that QGIS doesn't is blur so it should be simple enough to implement.

@gjmooney
Copy link
Collaborator Author

please update snapshots

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Thanks!

@martinRenou martinRenou merged commit d0299e9 into geojupyter:main Jan 27, 2025
2 checks passed
@gjmooney gjmooney deleted the heatmap_layer branch January 27, 2025 11:09
HaudinFlorence pushed a commit to HaudinFlorence/jupytergis that referenced this pull request Jan 28, 2026
* Start adding heatmap layer

* Add heatmap to layer context menu

* Get features into dropdown on form

* Clean up

* Add color to schema

* Add heatmap symbology panel

* Layer form something

* Add symbology state

* Iterate

* Clean up

* Refactor _onLayersChanged

* Implement layer type changing

* Set type in symbology

* IDK what rjsf wants anymore

* Recreate layer when changing feature

* Add blur and radius to symbology

* Update color ramp css

* Remove blur and radius from form

* Capitalize form labels

* Remove icon and fix label

* Clean up

* Choose defaults betters

* Add notebook api for heatmap

* Add heatmaps to Notebook test

* Update Playwright Snapshots

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants