mapbox / mapbox/leaflet-pip

Doen't seem to support GeometryCollection

Open
#30 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
202
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Leaflet-pip does not seem to find polygons inside of a GeometryCollection. If I get it right then not only mush layers be iterated, if the layer contains a GeometryCollection then all items within that must also be subjected to isPoly(l), but that probably require a bit of refactoring to process GeoJSON objects rather than layers.

So currently a Polygon as the one the below will never be found.
`
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"class": "LYRESTAD"
},
"geometry": {
"type": "GeometryCollection",
"geometries": [{
"type": "Polygon",
"coordinates": [
[
[14.00881897363853, 58.759130043177166],
[13.928815204319006, 58.93581644468062],
[14.120750873038237, 58.8843341034047],
[14.121862332723687, 58.88126014491872],
[14.174039271588722, 58.78656397216331],
[14.145110948923927, 58.767173887639935],
[14.12508839353722, 58.758541330342304],
[14.11335950201629, 58.76108407639584],
[14.06140521182085, 58.77226018822536],
[14.00881897363853, 58.759130043177166]
]
]
}]
}
}
`

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 layer iteration and isPoly(l) path mentioned in the issue, then trace how GeoJSON objects are processed. Reproduce the supplied FeatureCollection with a GeometryCollection containing a Polygon; done means the nested Polygon is found by leaflet-pip.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.