Opened 17 years ago

Closed 15 years ago

#597 closed defect (fixed)

lat/lon maps should wrap around 180 longitude

Reported by: hamish_nospam@… Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.2.0
Component: Projection Support Version: Trunk
Keywords: Cc: pcav
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

Description

Hi,

lat/lon maps which cross 180 longitude don't wrap.

This should at least happen when only one of -180,+180 is in view and nothing needs to be duplicated.

thanks,
Hamish

Attachments (1)

ll_nz_0.7.4.png (35.4 KB ) - added by hamish_nospam@… 17 years ago.
screenshot of New Zealand and offshore islands not wrapping at 180 lon QGIS 0.7.4 Debian package

Download all attachments as: .zip

Change History (8)

by hamish_nospam@…, 17 years ago

Attachment: ll_nz_0.7.4.png added

screenshot of New Zealand and offshore islands not wrapping at 180 lon QGIS 0.7.4 Debian package

comment:1 by hamish_nospam@…, 17 years ago

In that screenshot, the Chatham Islands on the far left should be within the grid (~176W). The grid runs from 160 to 185 (=175W).

Hamish

comment:2 by hamish_nospam@…, 17 years ago

test data: shapefile of New Zealand and offshore islands; extracted from the NOAA GSHHS dataset. (520k)

http://bambi.otago.ac.nz/hamish/grass/qgis/gshhs_nz_LL.tgz

Hamish

comment:3 by g_j_m, 17 years ago

Hamish,

The 180 degree line is a problem for most gis packages, qgis included.

A work-around that I use a lot is to transform the longitude data to 0->360. If your data is in postgis, recent versions include a shift_longitude (or something like that) that can be used to move the discontinuity to somewhere else. I also think that the proj4 library now supports a shift longitude feature that allows one to define a custom projection that does the shift too.

Another option that I use sometimes is to get qgis to convert the lat/long data to a projected coordinate system that doesn't have a discontinuity in the wrong place (e.g. NZGD2000 for your example dataset).

Gavin

comment:4 by timlinux, 17 years ago

Milestone: Version 0.8.2 Release

in reply to:  3 comment:5 by lutra, 15 years ago

Awaiting user input: unset
Cc: pcav added
Milestone: Version 1.0.3Version 1.2.0
Version: 0.8HEAD

Replying to g_j_m:

A work-around that I use a lot is to transform the longitude data to 0->360. If your data is in postgis, recent versions include a shift_longitude (or something like that) that can be used to move the discontinuity to somewhere else.

Hi, I'm testing this workaround and is fine for points, but I'm struggling with other geometries. Can you please post a working example for polygons? Thanks.

comment:6 by lutra, 15 years ago

Forget it, it worked also for polygons.

As for other cases, if there is no easy solution for problems such this one, and the there is a workaround, I suggest to wrote a note for the documentation/manual.

I can do that, agree?

comment:7 by dassau, 15 years ago

Resolution: fixed
Status: newclosed

We added a PostGIS subsubsection to the QGIS manual for 1.2 release. Thanks for testting and to Giovanni for the manual patch.

Otto

Note: See TracTickets for help on using tickets.