Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue rendering compound polygons (PostGIS) #5012

Merged
merged 1 commit into from
Sep 19, 2016
Merged

Issue rendering compound polygons (PostGIS) #5012

merged 1 commit into from
Sep 19, 2016

Conversation

tbonfort
Copy link
Member

Some arcs end up drawn as full circle. See the center of the attached image, the red circle.
pg_arcs
test-data, same eâs shown in image (sql dump) can be found here:
www.tydac.ch/download/compound_test.zip

@flavster58
Copy link
Author

maybe it is not clear enough: the circle should NOT be there. seems that some arcs go "banana".

@jratike80
Copy link

It has for sure taken too long without any feed back for you but as least for me it was not very easy to install the test data. For some reason the backup file was not recognized by my pgAdmin and I had to run the SQL commands by hand, as well as to save the data section into text file for importing it with COPY. I would have appreciated also a section of mapfile.

LAYER
NAME "compound_pg"
STATUS ON
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=test user=testuser"
DATA "geom from compound_test using unique bfs_nr"
PROCESSING "CLOSE_CONNECTION=DEFER"
TYPE LINE
STATUS ON
PROJECTION
"init=epsg:21781"
END
...

Anyway, I could reproduce the issue with Mapserver 7.0 and I can also see some full circles on the map. Next step would be to get one such geometry into a cage.

@jrahkonen
Copy link

I wonder if this QGIS issue has the same roots https://hub.qgis.org/issues/13893.

@ezala
Copy link

ezala commented May 26, 2016

As suspected by jrahkonen this is also an (closed) issue in QGIS (https://hub.qgis.org/issues/13893) and PostGIS (https://trac.osgeo.org/postgis/ticket/3099).

I was also able to reproduce the problem with a simple feature - kind of oval - formed by 2 circular strings and 2 lines.

When the distance between the points of the circular strings is sufficiently big the feature is drawn correctly by mapserver, but when it comes to cm or mm ranges the curves are completely wrong:

1m radius (correct):
m

1dm radius (correct):
dm

1mm radius (wrong):
mm

The problem can be solved by patching arcCircleCenter in mappostgis.c with the solution proposed by PostGIS (https://trac.osgeo.org/postgis/ticket/3099).

Example mapfile:
map.txt
Example data:
pg_data.txt
mappostgis.c patch provided by PostGIS:
arc_circle_center_patch.txt

@tbonfort tbonfort self-assigned this May 29, 2016
@tbonfort tbonfort added this to the 7.0.2 Release milestone May 29, 2016
@jmckenna jmckenna merged commit fa4e319 into MapServer:branch-7-0 Sep 19, 2016
@jmckenna
Copy link
Member

Tested successfully using @ezala's ovals, in PostgreSQL 9.5.4 and PostGIS 2.2.2

ttt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants