Opened 11 years ago

Closed 4 years ago

Last modified 4 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 11 years ago.
longitudeWrap version
ST_WrapX.sql (2.2 KB) - added by strk 10 years ago.

Download all attachments as: .zip

Change History (14)

Changed 11 years ago by strk

Attachment: longitudeWrap.sql added

longitudeWrap version

comment:1 Changed 11 years ago by strk

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

comment:2 Changed 11 years ago by strk

Summary: ST_Wrap ?ST_HWrap

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

comment:3 Changed 10 years ago by strk

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.

Changed 10 years ago by strk

Attachment: ST_WrapX.sql added

comment:4 Changed 9 years ago by strk

Milestone: PostGIS 2.0.0PostGIS Future
Version: 1.5.Xtrunk

comment:5 Changed 4 years ago by strk

Milestone: PostGIS FuturePostGIS 2.3.0

I'm on this, will be included in 2.3.0

comment:6 Changed 4 years ago by strk

Resolution: fixed
Status: assignedclosed

In 14961:

Implement lwgeom_wrapx and ST_WrapX

Includes tests (both cunit and regress) and documentation.

Closes #454

comment:7 Changed 4 years ago by pramsey

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 Changed 4 years ago by strk

Priority: mediumblocker
Resolution: fixed
Status: closedreopened

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

comment:9 Changed 4 years ago by pramsey

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 Changed 4 years ago by strk

Resolution: fixed
Status: reopenedclosed

In 14968:

Fix wrapping of multigeometry elements becoming multi on wrap

Closes #454 again

comment:11 Changed 4 years ago by strk

In 14969:

Use int for iterating over geometry index

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

comment:12 Changed 4 years ago by strk

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.