2

I have a REST service that returns shapes as json. The shapes represent various natural features.

The problem is the precision of the coordinates. Currently, 11 decimal places of precision are returned for each vertex. For these features, that level of precision is ridiculous and one or two places is more than adequate.

I'm not sure of this can easily be controlled at the service level or if I can do this at the ArcSDE level. At this point, I just want to control the number of decimal places returned for the vertices and it doesn't matter where I make the change. If I need to create a duplicate feature class that contains reduced precision and access it with another service, I'm okay with that.

This is Oracle 11g. Geometry is stored as ST_GEOMETRY. XY Resolution of the source feature class is 0.0001 meter.

The spatial reference of the source ArcSDE feature class is EPSG:2823. The service matches.

When I use Data Management Tools > Features > Add XY Coordinates, the resulting attributes are displayed to 0.0001 meters (matches the XY Resolution).

Here's a sample of the coordinates from the service. The first four decimal places are correct and this matches the XY Resolution. Beyond the 4th decimal place shouldn't be returned at all (my opinion) but looks like floating point artifacts.

  [ ***556.01240000036, ***194.83640000038 ],
  [ ***575.52120000031, ***232.26889999956 ],
  [ ***577.23070000019, ***239.59820000082 ],
  [ ***601.91760000028, ***295.97729999945 ],
  [ ***612.37299999967, ***327.78720000014 ],
  [ ***647.73350000009, ***402.59310000017 ],
  [ ***671.43950000033, ***444.35270000063 ],
  [ ***689.12970000042, ***481.14739999922 ],
  • Please edit the question to contain the coordinate system and X/Y coordinate reference parameters of the source feature class. It wouldn't hurt to specify which RDBMS you are using (including version) and what geometry storage is utilized – Vince Dec 3 '15 at 18:08
  • Again, what coordinate system? If the source layer xy_units is 10000 is should not be possible to generate coordinates beyond four places (they would be all zeroes). Does the service publish in a different coordinate system? – Vince Dec 3 '15 at 18:44
  • I've written a Java servlet wrapper around several services using the JSON.org JSONObject and JSONArray classes to reformat coordinate doubles to my required precision. – Vince Dec 3 '15 at 19:02
  • Again, in what coordinate system is the source table? In what coordinate system is the REST service? If they're different, what is the coordinate reference resolution in the service? – Vince Dec 3 '15 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.