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

feat: multipart support #164

Conversation

charlieforward9
Copy link
Collaborator

@charlieforward9 charlieforward9 commented Nov 25, 2024

Tried to acknowledge the contributions of the previous contributors to for getting multipart geometries working. Closes #42 and #66 and #158

Co-authored-by: Kanahiro Iguchi [email protected] @Kanahiro
Co-authored-by: Liam O'flynn [email protected] @quorth0n

Includes Prettier formatting

@charlieforward9
Copy link
Collaborator Author

charlieforward9 commented Nov 25, 2024

@robertleeplummerjr I tested this using the Antarctica.geojson file and it seems to render "good enough" for now. A strange overlap issue could be addressed down the road, when someones use case requires it. Can be merged. I will be depending on this PR branch till then.

Screenshot 2024-11-25 at 3 40 19 PM

Also willing to take responsibility for managing this repo if you find yourself too busy. Add me as a contributor if you'd like a teammate in this. (Still highly undereducated in the GL space, but managing repos/package releases is pretty straightforward)

@charlieforward9

This comment was marked as off-topic.

@trafficonese
Copy link
Contributor

Thats awesome, thanks! Did you also test out Multi-Linestrings?

@charlieforward9
Copy link
Collaborator Author

@trafficonese I did not. I only needed multipolygon for my use case.

@charlieforward9 charlieforward9 changed the base branch from master to next-leaflet November 28, 2024 18:39
@charlieforward9 charlieforward9 changed the base branch from next-leaflet to master November 28, 2024 18:39
README.md Show resolved Hide resolved
Co-authored-by: Kanahiro Iguchi <[email protected]>
Co-authored-by: Liam O'flynn <[email protected]>
@charlieforward9
Copy link
Collaborator Author

charlieforward9 commented Dec 2, 2024

@robertleeplummerjr this should be ready to merge and all related issues/pr's can be closed.

Just a reminder there are some stragler issues to close from my previous PR, see this comment

Finally, publishing the newest release on Github should close #154

@robertleeplummerjr robertleeplummerjr merged commit adae379 into robertleeplummerjr:master Dec 2, 2024
@charlieforward9
Copy link
Collaborator Author

@robert-lore @robertleeplummerjr thank you for the merge. Do you plan to make a release and close the resolved issues? I can help you manage this repo if you find yourself without time.

@robert-lore
Copy link

I'm installing it on my mac and was having trouble.

@charlieforward9
Copy link
Collaborator Author

@robert-lore Were they from my contributions or your machine?

@arvii
Copy link

arvii commented Dec 9, 2024

@charlieforward9 does your fix support combination of Polygon and MultiPolygon on a FeatureCollection? 🙇
Screenshot 2024-12-09 at 9 35 00 PM

@robert-lore
Copy link

Just removed canvas, which was causing my install issue, and published.

@charlieforward9
Copy link
Collaborator Author

@charlieforward9 does your fix support combination of Polygon and MultiPolygon on a FeatureCollection? 🙇

Worth taking a look and letting me know. I just took the contributions of @quorth0n and @Kanahiro and applied them to the latest branch, so please let me know if you have any issues.

@charlieforward9
Copy link
Collaborator Author

Just removed canvas, which was causing my install issue, and published.

@robert-lore Great, thank you! I am having trouble running my test suite because of an improperly defined layer.canvas issue. I am going to spend the rest of the day looking into this. If you have any pointers for how to get around this, please share them in #110

@trafficonese
Copy link
Contributor

@charlieforward9 does your fix support combination of Polygon and MultiPolygon on a FeatureCollection? 🙇

@arvii , yes it works also for a combination of polygons and multipolygons.
image

@arvii
Copy link

arvii commented Dec 10, 2024

@charlieforward9 does your fix support combination of Polygon and MultiPolygon on a FeatureCollection? 🙇

@arvii , yes it works also for a combination of polygons and multipolygons. image

Hi @trafficonese Thank you so much for checking also. Could you please send me the sample data you tested? I want to verify if my format is correct. I tested it with a combination of Polygon and MultiPolygon in a GeoJSON FeatureCollection, but only the Polygon rendered. When I tested a GeoJSON Feature with a single MultiPolygon, it rendered correctly. Thank you so much! 🙇

@trafficonese
Copy link
Contributor

@arvii It's a very simple Featurecollection:

const data: FeatureCollection<Geometry> = {
  type: "FeatureCollection",
  features: [
    {
      type: "Feature",
      properties: { name: "Polygon 1" },
      geometry: {
        type: "Polygon",
        coordinates: [
          [
            [102.0, 0.0],
            [103.0, 0.0],
            [103.0, 1.0],
            [102.0, 1.0],
            [102.0, 0.0],
          ],
        ],
      },
    },
    {
      type: "Feature",
      properties: { name: "MultiPolygon 1" },
      geometry: {
        type: "MultiPolygon",
        coordinates: [
          [
            [
              [100.0, 0.0],
              [101.0, 0.0],
              [101.0, 1.0],
              [100.0, 1.0],
              [100.0, 0.0],
            ],
          ],
          [
            [
              [100.2, 0.2],
              [100.8, 0.2],
              [100.8, 0.8],
              [100.2, 0.8],
              [100.2, 0.2],
            ],
          ],
        ],
      },
    },
    {
      type: "Feature",
      properties: { name: "Polygon 2" },
      geometry: {
        type: "Polygon",
        coordinates: [
          [
            [104.0, 0.0],
            [105.0, 0.0],
            [105.0, 1.0],
            [104.0, 1.0],
            [104.0, 0.0],
          ],
        ],
      },
    },
    {
      type: "Feature",
      properties: { name: "MultiPolygon 2" },
      geometry: {
        type: "MultiPolygon",
        coordinates: [
          [
            [
              [102.0, 2.0],
              [103.0, 2.0],
              [103.0, 3.0],
              [102.0, 3.0],
              [102.0, 2.0],
            ],
          ],
          [
            [
              [102.2, 2.2],
              [102.8, 2.2],
              [102.8, 2.8],
              [102.2, 2.8],
              [102.2, 2.2],
            ],
          ],
        ],
      },
    },
  ],
};

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

Successfully merging this pull request may close these issues.

Multi-part polygons are never drawn.
5 participants