Opened 14 years ago

Closed 8 years ago

Last modified 8 years ago

#454 closed enhancement (fixed)

ST_WrapX

Reported by: strk Owned by: strk
Priority: blocker Milestone: PostGIS 2.3.0
Component: postgis Version: master
Keywords: Cc:

Description

Still looking for a good name, anyway the idea is to allow people to "split" a set of geometries in a table so that every component falling off a given X-value is X-shifted by a given amount. Tipical use is to make a wgs84 map visible as 0,360 rather than -180,180 or as whatever makes sense of a specific use (think pacific).

This was referred to as ST_ShiftLongitude on the mailing list http://postgis.refractions.net/pipermail/postgis-devel/2010-February/008886.html

But the "Longitude" part is misleading as it may be useful in mercator too for example..

Attachments (2)

longitudeWrap.sql (1.9 KB ) - added by strk 14 years ago.
longitudeWrap version
ST_WrapX.sql (2.2 KB ) - added by strk 14 years ago.

Download all attachments as: .zip

Change History (14)

by strk, 14 years ago

Attachment: longitudeWrap.sql added

longitudeWrap version

comment:1 by strk, 14 years ago

Milestone: PostGIS 2.0.0
Owner: changed from pramsey to strk
Status: newassigned

comment:2 by strk, 14 years ago

Summary: ST_Wrap ?ST_HWrap

I think ST_HWrap is a good name. Now we have a name, half work is done :)

comment:3 by strk, 14 years ago

Summary: ST_HWrapST_WrapX

HWrap I still didn't like as it assumes X is horizontal. So it's now called ST_WrapX. The attached version also makes use of the new ST_Split function and calls ST_Union as the last step.

Now it seems a pretty good and complete function to let down to C.

by strk, 14 years ago

Attachment: ST_WrapX.sql added

comment:4 by strk, 12 years ago

Milestone: PostGIS 2.0.0PostGIS Future
Version: 1.5.Xtrunk

comment:5 by strk, 8 years ago

Milestone: PostGIS FuturePostGIS 2.3.0

I'm on this, will be included in 2.3.0

comment:6 by strk, 8 years ago

Resolution: fixed
Status: assignedclosed

In 14961:

Implement lwgeom_wrapx and ST_WrapX

Includes tests (both cunit and regress) and documentation.

Closes #454

comment:7 by pramsey, 8 years ago

I'm getting a compile warn on this:

lwgeom_wrapx.c:26:9: warning: 'POSTGIS_DEBUG_LEVEL' macro redefined [-Wmacro-redefined]
#define POSTGIS_DEBUG_LEVEL 4
        ^
./../postgis_config.h:123:9: note: previous definition is here
#define POSTGIS_DEBUG_LEVEL 0

comment:8 by strk, 8 years ago

Priority: mediumblocker
Resolution: fixed
Status: closedreopened

I'm actually debugging a crash, so will reopen this until that is fixed.

comment:9 by pramsey, 8 years ago

Here's another warning for the hopper

lwgeom_wrapx.c:131:14: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
                        while (--i>=0) lwgeom_free(wrap_geoms[i]);
                               ~~~^ ~
1 warning generated.

comment:10 by strk, 8 years ago

Resolution: fixed
Status: reopenedclosed

In 14968:

Fix wrapping of multigeometry elements becoming multi on wrap

Closes #454 again

comment:11 by strk, 8 years ago

In 14969:

Use int for iterating over geometry index

Avoids a potential infinite loop on split error (see #454)

comment:12 by strk, 8 years ago

Paul please try with r14969 — we really need to add those compiler flags by default :/

[ see #3037 ]

Note: See TracTickets for help on using tickets.