Ticket #184 (closed defect: worksforme)

Opened 4 years ago

Last modified 4 years ago

ST_AsGeoJSON Precision doesn't match WKT

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 1.4.1
Component: postgis Version: 1.4
Keywords: Cc: josh.hansen@…

Description

# select st_asgeojson(position), st_astext(position) from asset_positions limit 1;                                        st_asgeojson                                        |           st_astext         
--------------------------------------------------------------------------------------------+-------------------------------
 {"type":"Point","coordinates":[-104.913632199999995,39.771887000000000,0.000000000000000]} | POINT(-104.9136322 39.771887)

Other serializations do match. Something worth investigating.

Change History

Changed 4 years ago by pramsey

  • cc josh.hansen@… added

Changed 4 years ago by mcayland

I don't think this is a bug, since the ST_As*() functions have fixed precision rounding which defaults to 15 places (will be significant figures in trunk) compared to the WKT parser. If you really need this level of accuracy, you should probably be using WKB to prevent rounding errors.

Paul, do you think we can resolve this as "not a bug"?

ATB,

Mark.

Changed 4 years ago by pramsey

  • status changed from new to closed
  • resolution set to worksforme

I'm resolving as werks4me, unless I hear a use case that requires a fix.

Note: See TracTickets for help on using tickets.