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

Support Parsing of MultiPolygon in WKT Format #183

Open
mdbuck opened this issue Oct 5, 2017 · 9 comments
Open

Support Parsing of MultiPolygon in WKT Format #183

mdbuck opened this issue Oct 5, 2017 · 9 comments

Comments

@mdbuck
Copy link

mdbuck commented Oct 5, 2017

Executing WKTParser.parseAll("MULTIPOLYGON (((-72.40704336 41.9571927, -72.4070466 41.95713969, -72.4071366 41.95329372, -72.40790556 41.95300077, -72.40704336 41.9571927)))") results in java.lang.RuntimeException: Extra(...704336 41.9571927))), [traced - not evaluated])

Is this a limitation of the parser of project-wide?

Thanks.

@harsha2010
Copy link
Owner

WKT parser does not support multipolygons yet
Neither does Shapefile format. Only GeoJSON does right now
It's not prioritized, happy to accept contributions :)

@mdbuck
Copy link
Author

mdbuck commented Oct 5, 2017

I have no problem working on it but just need to know if it's just a parser issue or if support for MultiPolygons is problematic in other areas of the project. I would not want to implement in the WKTParser only to find that more work is needed in other, more "complicated" areas of the project that may take more time to address.

Thanks.

@harsha2010
Copy link
Owner

Multipolygons are in general not fully supported in parsing. But once parsed they will be treated as one polygon per row essential flatmapping them. The rest of the processing then is identical

@mdbuck
Copy link
Author

mdbuck commented Oct 5, 2017

Excellent. Thanks!

@harsha2010
Copy link
Owner

@mdbuck if you are implementing this, it might be good to follow the same approach as GeoJSON where one line of multi polygon results in multiple rows, one per polygon. This might require slightly generalizing the WKT expression. I can help with this, let me know if you'd want a skeleton PR that you can extend

@mdbuck
Copy link
Author

mdbuck commented Oct 6, 2017

Since I do not know what "generalizing the WKT expression" means any help is appreciated :)

@harsha2010
Copy link
Owner

@mdbuck fair enough :), will create a PR with some tests and missing pieces for you to add in for this functionality... I should have time to put something together this weekend and will ping you on the PR so you can work off it
Thanks for contributing!

@geoHeil
Copy link

geoHeil commented Dec 19, 2017

@harsha2010 is there some progress regarding this issue?

roblovelock pushed a commit to roblovelock/magellan that referenced this issue Feb 12, 2018
@roblovelock
Copy link

I have created a pull request. It isn't exactly what was discussed above, but you may find it useful until a full solution working the same as GeoJson is implemented.

#195

roblovelock pushed a commit to roblovelock/magellan that referenced this issue Feb 14, 2018
roblovelock pushed a commit to roblovelock/magellan that referenced this issue Feb 14, 2018
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

No branches or pull requests

4 participants