Ticket #3621 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Support Curved features in PostGIS

Reported by: pramsey Owned by: pramsey
Priority: normal Milestone: 6.0 release
Component: PostGIS Interface Version: 5.6
Severity: normal Keywords: curve
Cc: jmckenna, astrid.emde@…, benjamin.mueller@…

Description

The SQL/MM curve types (CircularString?, CompoundCurve?, CurvePolygon?, MultiCurve?, MultiSurface?) are not currently supported by the PostGIS driver. They should be stroked to equivalent linestring based features and then passed to the standard rendering stack.

Attachments

ms-curve-20101127.patch Download (28.5 KB) - added by pramsey 2 years ago.
First cut of a patch
ms-curve-20101128.patch Download (28.0 KB) - added by pramsey 2 years ago.
handles closed circles and straight curves
ms-curve-20101129.patch Download (42.2 KB) - added by pramsey 2 years ago.
Added more comments, and preemptive support for PostGIS 2.0
ms-curve-20101130.patch Download (45.3 KB) - added by pramsey 2 years ago.
Remove unneeded SQL functions and add a few more comments
ms6-curve-20101130.patch Download (62.7 KB) - added by pramsey 2 years ago.
Patch for MS6 (trunk)
ms6-curve-20101201.patch Download (62.9 KB) - added by pramsey 2 years ago.
Patch against trunk w/ VCC changes
test.sql Download (1.6 KB) - added by jmckenna 2 years ago.
Test SQL to load SQL-MM curves that are listed in the PostGIS documentation.
curve.png Download (65.8 KB) - added by astrid_emde 2 years ago.
first test with MS6.0 - not enough basepoints
ms6-curve-20101220.patch Download (63.1 KB) - added by pramsey 2 years ago.
denser curve treatment

Change History

Changed 2 years ago by pramsey

First cut of a patch

Changed 2 years ago by pramsey

  • cc jmckenna added

It looks like the two special cases of circular arcs that form circles and circular arcs that are co-linear are not being correctly handled right now. Need to address those.

Changed 2 years ago by pramsey

  • cc astrid.emde@… added; jmckenna removed

Changed 2 years ago by pramsey

  • cc jmckenna added

Changed 2 years ago by pramsey

handles closed circles and straight curves

Changed 2 years ago by pramsey

Added more comments, and preemptive support for PostGIS 2.0

Changed 2 years ago by pramsey

Remove unneeded SQL functions and add a few more comments

Changed 2 years ago by pramsey

Patch for MS6 (trunk)

Changed 2 years ago by jmckenna

Paul, I'm testing the MS6(trunk) patch, building on Windows with MSVC 2008, and I was getting errors of "undeclared identifier M_PI", so I added the following to mappostgis.c locally:

(line 63)
/* required for MSVC */
#define _USE_MATH_DEFINES

(line 68)
#include <math.h>

With that change, MapServer compiles and I am able to generate a map image of your table's curvepolygons.

Changed 2 years ago by jmckenna

For some reason hunk#5 and #10 of that patch fail for patching mappostgis.c for me...will take a look (I deleted my old mappostgis.c and re-checked out a fresh one...odd)

Changed 2 years ago by jmckenna

Paul your 'ms6-curve-20101130.patch' was made against r10772 but 'ms6-curve-20101201.patch' was made against r10769 ? was this on purpose?

Changed 2 years ago by pramsey

Figured it out, I pulled the last one against the 5.6 branch instead of against trunk, and the trunk patch is on my laptop, not this desktop machine. Curses. One moment.

Changed 2 years ago by pramsey

Patch against trunk w/ VCC changes

Changed 2 years ago by jmckenna

Test SQL to load SQL-MM curves that are listed in the PostGIS documentation.

Changed 2 years ago by jmckenna

Changed 2 years ago by astrid_emde

first test with MS6.0 - not enough basepoints

Changed 2 years ago by astrid_emde

  • cc benjamin.mueller@… added

Benj did some tests - his output generates lines with not enough base points (see output  http://trac.osgeo.org/mapserver/attachment/ticket/3621/curve.png). So the lines did not fit on each other. Is there a parameter to produce more base points in the mapfile?

Changed 2 years ago by pramsey

The problem is that the number of segments is currently dictated by the angular distance covered by the arc segment. If it's a big angular distance, more points, a shallow angle, fewer. I think I'm going to have to completely change that logic to be more of a "number of points between start and end" basis. That will exchange underdetermination in the cases above with overdetermination (too many points) for very short segments. The trouble is, we cannot distinguish "very short" easily without more contextual information than we have about resolution, etc.

Changed 2 years ago by pramsey

denser curve treatment

Changed 2 years ago by pramsey

Give this patch a shot. All these approaches are going to end up looking a little non-dense if you zoom in enough on a sufficiently shallow curve. I just found that over-dense lines looked bad in their own way. You can alter the SEGMENT_ANGLE and SEGMENT_MINPOINTS values at compile to for the moment to get different behaviour.

Changed 2 years ago by astrid_emde

Feedback from Benjamin. The patch works fine. Thanks for the enhancement.

Changed 2 years ago by pramsey

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

Committed to trunk at r10846

Note: See TracTickets for help on using tickets.