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

to-geojson fail on a simple polygon #74

Open
0xbase12 opened this issue Dec 13, 2021 · 2 comments
Open

to-geojson fail on a simple polygon #74

0xbase12 opened this issue Dec 13, 2021 · 2 comments

Comments

@0xbase12
Copy link

(require '[geo.io :as gio])
=> nil

; read-wkt is ok 
(gio/read-wkt "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))")
=> #object[org.locationtech.jts.geom.Polygon 0x223e81a9 "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"]

; issue and exception thrown
(gio/to-geojson (gio/read-wkt "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"))
Execution error (NoSuchMethodError) at org.wololo.jts2geojson.GeoJSONWriter/convert (GeoJSONWriter.java:79).
'org.locationtech.jts.geom.LineString org.locationtech.jts.geom.Polygon.getExteriorRing()'

Simple fix is perhaps by updating libraries:
locationtech/spatial4j#192

@0xbase12
Copy link
Author

To make it work, I used following versions:

   [factual/geo "3.0.1" :exclusions [[org.locationtech.jts/jts-core]
                                     [org.locationtech.spatial4j/spatial4j]
                                     [org.wololo/jts2geojson]]]
   [org.locationtech.spatial4j/spatial4j "0.8"]
   [org.locationtech.jts/jts-core "1.18.2"]
   [org.wololo/jts2geojson "0.15.0"]]

When I use [org.wololo/jts2geojson "0.16.1"]] I'm hitting an issue at repl load time of geo.io namespace.

@worace
Copy link
Contributor

worace commented Dec 13, 2021

@0xbase12 that seems like a great find. Any chance you'd be able to open a PR bumping those versions? Would be great to include your example as a test case as well.

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

2 participants