Select to view content in your preferred language

Drawing region from WKT string

2712
3
10-21-2016 10:14 AM
JasonChristian
Emerging Contributor

Hi, I have a text file consisting a Well-Known Text (WKT) string. The WKT string will be used to define regions (basically, list of lat-lon) where I would draw it onto the MapView. Can the Android's ArcGIS SDK parse the WKT and draw the region defined by the string? If so, which class to use and how should I use it?

Thanks before

0 Kudos
3 Replies
AlexanderNohe1
Honored Contributor

Jason Christian

I do not see any methods currently listed in the API nor do I see any methods for this listed in the beta API.  This might make a good enhancement request and I would encourage you to either join the early adopter community by visiting this link ArcGIS Runtime SDK for Android | ArcGIS for Developers  and clicking join beta and then leaving feedback or by contacting your local esri distributor office and creating a case with support.

Additionally, it may be possible to display the points still with a custom utility class written to iterate over the data within the text file.  Do you have a small sample of the text file that you could upload so we could see if we might be able to write a utility class as a community?  This may be something that we could post in our developer-support github page.

0 Kudos
JasonChristian
Emerging Contributor

The WKT is in a form of string. There's already a library that can parse a WKT string, but only available in Javascript.

Wicket - Lightweight Javascript for WKT [Sandbox] 

That's an example string of a multipolygon (You can just replace the coords wit lat-lon). There're several geometries supported by WKT, such as points, polygons, lines, up to complex geometries like curve, Polyhedralsurface, etc. It will be a nice addition if the SDK could:

- Parse WKT string into a ready-made object

- The said object can be directly drawn onto the map

- Several utility methods such as determining if a point is inside a region, if 2 regions collide with each other, etc.

Sadly, I am not at my workspace right now, so I can just give that much

AlexanderNohe1
Honored Contributor

Hello Jason Christian

Those utility methods you are looking for exist in the GeometryEngine

GeometryEngine | ArcGIS Android 10.2.8 API 

Additionally, I would believe that reaching out to your local esri distributor and inquiring for an enhancement request to add this functionality the SDK would be worth while.

0 Kudos