Are we sure GeoTools and ESRI geometry-api have the same GeoJSON in mind?

I would look at *test cases* for the GeoTools functionality. Where possible
I always try and get the docs to include example code directly from test
cases (so it is not out of date).

The geojson module is unsupported, so while it compiles it may not run?
Kind of surprising this has not been popular enough to be completed 🙂

There isa specific GeometryJSONTest
<https://github.com/geotools/geotools/blob/main/modules/unsupported/geojson/src/test/java/org/geotools/geojson/GeometryJSONTest.java>
that
appears to have examples of using Geometry in isolation (not writing to a
file).
--
Jody Garnett


On May 15, 2024 at 9:39:27 PM, Phil Scadden <p.scad...@gns.cri.nz> wrote:

> Ultimately, what I am trying to do is read some features from a geopkg
> using geotools, fidding with contents of the feature and then writing the
> Feature to an ESRI FeatureServer using the REST API. Along the way, I have
> to get the geotools geometry converted to an ESRI Geometry class.
>
>  The ESRI OGCGeometry (https://esri.github.io/geometry-api-java
> <https://esri.github.io/geometry-api-java%20can> can convert to ESRI
> geometry, but the fromGeoJson seems to be only method for creating a
> OGCGeometry.
>
>
>
> What I am struggling with is getting a GeoJSON string out of geotools. I
> added gt-geojson module but can only see method for writing to file. Am I
> missing something blindingly obvious here? The documentation doesn’t seem
> up to date – pointing to methods that (eg GeoJSONWriter) that don’t exist
> (and pages 404 in the Javadoc).
>
>
>
> Using 31.0
>
>
>
> Also looking at option of using a WKT route instead.
>
>
>
>
>
> ________________________________________________
>
> Ngā mihi, Nā Phil Scadden (he/him)
>
> Te Raraunga me te Tātaritanga Mokowā Aronuku (Geospatial Data and
> Analysis)
>
> *GNS Science* *Te Pῡ Ao*
>
> 13A Alma St, Renwick, 7204
>
> New Zealand Ph +64 27 3463185
>
>
>
> “Whāia te iti kahurangi ki te tūohu koe me he maunga teitei”
>
>
> Notice: This email and any attachments are confidential and may not be
> used, published or redistributed without the prior written consent of the
> Institute of Geological and Nuclear Sciences Limited (GNS Science). If
> received in error please destroy and immediately notify GNS Science. Do not
> copy or disclose the contents.
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to