Ticket #597 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

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
Platform Version: Platform: Debian
Must Fix for Release: No 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

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

Change History

Changed 6 years ago by hamish_nospam@…

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

  Changed 6 years ago by hamish_nospam@…

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

  Changed 6 years ago by hamish_nospam@…

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

follow-up: ↓ 5   Changed 6 years ago by g_j_m

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

  Changed 6 years ago by timlinux

  • milestone set to Version 0.8.2 Release

in reply to: ↑ 3   Changed 4 years ago by lutra

  • cc pcav added
  • status_info unset
  • version changed from 0.8 to HEAD
  • milestone changed from Version 1.0.3 to Version 1.2.0

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.

  Changed 4 years ago by lutra

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?

  Changed 4 years ago by dassau

  • status changed from new to closed
  • resolution set to fixed

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.