Opened 13 years ago
Closed 13 years ago
#3621 closed enhancement (fixed)
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 (9)
Change History (22)
by , 13 years ago
Attachment: | ms-curve-20101127.patch added |
---|
comment:1 by , 13 years ago
Cc: | 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.
comment:2 by , 13 years ago
Cc: | added; removed |
---|
comment:3 by , 13 years ago
Cc: | added |
---|
by , 13 years ago
Attachment: | ms-curve-20101128.patch added |
---|
handles closed circles and straight curves
by , 13 years ago
Attachment: | ms-curve-20101129.patch added |
---|
Added more comments, and preemptive support for PostGIS 2.0
by , 13 years ago
Attachment: | ms-curve-20101130.patch added |
---|
Remove unneeded SQL functions and add a few more comments
comment:4 by , 13 years ago
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.
comment:5 by , 13 years ago
comment:6 by , 13 years ago
comment:7 by , 13 years ago
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.
by , 13 years ago
Test SQL to load SQL-MM curves that are listed in the PostGIS documentation.
comment:8 by , 13 years ago
- verified the latest patch on MapServer trunk with MSVC 2008 on Windows
- tested using Paul's test sql and also sql generated from PostGIS documentation on SQL/MM
- documented changes for MapServer 6.0: http://www.mapserver.org/trunk/input/vector/postgis.html#support-for-sql-mm-curves
comment:9 by , 13 years ago
Cc: | 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?
comment:10 by , 13 years ago
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.
comment:11 by , 13 years ago
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.
comment:12 by , 13 years ago
Feedback from Benjamin. The patch works fine. Thanks for the enhancement.
First cut of a patch