Ticket #412 (closed enhancement: wontfix)

Opened 3 years ago

Last modified 3 years ago

Improve coordinate formatting for ST_IsValidReason

Reported by: mwtoews Owned by: pramsey
Priority: low Milestone: PostGIS 1.5.1
Component: postgis Version: 1.5.X
Keywords: Cc:

Description

A message from ST_IsValidReason(geometry) shows the message:

Self-intersection[523991 6.5222e+06]

to describe a point with Easting/Northing? coordinates. What I find odd is the mixed conventional numeric and exponential forms.

I [still] can't find the source code for this, but I'm certain there is a "%g %g" formatting code somewhere in there. Although %g is usually a nice formatter, it is unfortunate that it happens to change to exponential format numbers >=1e+06, which is the range of many projected (i.g., UTM) coordinates (particularly northern ones). [Note, this is probably compiler/platform dependent.]

To make consistent formatting of these coordinates across platforms, and to make it show projected coordinates nicely, I suggest using the formatting code: "%.7g %.7g"

This will use exponential form for numbers >=1e+07, which most earth-based Easting/Northing? coordinates fall within.

Change History

Changed 3 years ago by mwtoews

  • priority changed from medium to low
  • type changed from defect to enhancement

Changed 3 years ago by pramsey

  • milestone set to PostGIS 1.5.1

Changed 3 years ago by pramsey

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

Bad news, this is actually in the GEOS CAPI, not in PostGIS, so this ticket needs to migrate over there...

Changed 3 years ago by pramsey

Huh, I didn't realize this thread was so self-referencing...

 http://trac.osgeo.org/geos/ticket/329

Note: See TracTickets for help on using tickets.