wkt geometry to esri rest json geometry

3161
1
02-23-2018 02:22 AM
GlibaRoland
Occasional Contributor

Hy!

I have just started programing in java. We have a java soap interface for simple fast operations with geom data (insert,select, update,geocode etc) Now I'd like to create a BufferService in java to our interface. The part of requesting the geometryservice  and convert json polygon to wkt is done with changing some character. The geometry must to be in wkt in the request and in response as well. So my problem is how to convert wkt geometry to json for the request when the geometry can be any main type of geometry. I found the esri geometry java api but it's little more difficult to me than other geometry api like vividsolutions'. But that json object is not rest compatible json so can anybody help me like show me a sample code how to use esri java geometry api to convert geometry wkt to rest json? I would be very very grateful

Thank you.

0 Kudos
1 Reply
TedKowal
Honored Contributor

I wish I had a definitive answer for you --- I have ran across some libraries that can do it some what each have their own limitations and languages.  When working with geoJson "Multi" geometries were my nemesis.  So much that I just simply re-wrote everthing to accept WKT and left out all the json formats.  WKT's standard on the flip side is not well accepted and universal as well... so I simply was using SQL server's flavor of WKT's.  That said here are some of the libraries that I had some limited success with.

GitHub - arthur-e/Wicket: A modest library for moving between Well-Known Text (WKT) and various fram... 

GitHub - mapbox/wellknown: GeoJSON-emitting WKT parser for browsers and node 

Convert GeoJSON to/from WKT in Python. #python #geojson #geometry · GitHub 

0 Kudos