NASA-AMMOS / NASA-AMMOS/3DTilesRendererJS

GeoJSONOverlay: Possible improvements

Open
#1,327 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.5k
Forks
416
Avg merge
17h 52m
Merged PRs (30d)
37

Description

Features
  • Add support for a form of "styling" the GeoJSON.
  • Add support for multiple GeoJSON shapes (array of URLs, shapes).
  • Add support for raycasting / sampling geojson coordinate based on mouse position / or latlon value.
  • Add support for regenerating images based on color / shape / styling changes. #1413
  • Allow for recoloring / rerendering sub shapes #1413
Quality
  • Handle GeoJSON shapes across the +-180 degree longitude boundary.
  • Add padding based on pixel size, stroke size, and point size to ensure shapes are included in bounding box calculations to prevent shape clipping.
  • Add support for world space sizing so line width etc does not scale based on zoom / pixel size.
  • Consider scaling canvas dimensions based on ellipsoid-projected size to retain roughly square pixels, prevent distortion.
  • Add an option for world-space point and stroke width sizes.
  • Calculate "bounds" per tile and accounting for resolution to avoid stroke and points being cut off.
  • Improve texture coverage in the planar projection case to only extend the texture across the space covered by "frame" rather than the full texture space, which may be largely unused.
  • #1310
Memory
  • Add support for using "RedFormat" if users are using the texture for just alpha data (swap alpha channel to r channel)
  • Add support for limiting the bounds in which images are produced to only where shapes are present. Fixed in #1328.
  • Add support for only loading tiles where geojson shapes are present including between geojson shapes (related to #1366, #1413)
Performance
  • Cache all shapes as "Path2D" instances to draw them (2x perf improvement)
  • Allow for a more-granular "redraw"-style function that marks geojson as having had just colors changed so bounds do not have to be regenerated. Or just one shape as having changed to avoid drawing any tiles that do not overlap it.
  • See if converting to SVG is performant.
    • Styling is not so straightforward here since it requires making a data url to draw to canvas.
  • Use web workers and offscreen canvas.
  • Geojson drawing is done immediately when "lockTexture" is called but it would be best to defer the drawing. However we need to account for preparing tiled data generation.
  • "redraw" happens immediately all at once though it would be best to queue this and do it over time, prioritizing the currently visible tiles.
  • Cache geojson shape bounds to avoid recalculations #1419

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the GeoJSONOverlay implementation and review the remaining unchecked items, beginning with the feature or quality area you intend to address. Check the linked issues for already completed or related work, and define a specific scope and acceptance criteria before coding; done cannot be determined for the full wishlist as written.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, json, three.js
Domain
computer-graphics, data-visualization, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.