Opened 15 years ago

Closed 14 years ago

#184 closed defect (worksforme)

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 (3)

comment:1 by pramsey, 15 years ago

Cc: josh.hansen@… added

comment:2 by mcayland, 15 years ago

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.

comment:3 by pramsey, 14 years ago

Resolution: worksforme
Status: newclosed

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

Note: See TracTickets for help on using tickets.