Bug report #597

lat/lon maps should wrap around 180 longitude

Added by hamish_nospam-yahoo-com - over 17 years ago. Updated about 13 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Projection Support
Affected QGIS version: Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data: Copied to github as #:10656

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

ll_nz_0.7.4.png - screenshot of New Zealand and offshore islands not wrapping at 180 lon QGIS 0.7.4 Debian package (35.4 KB) hamish_nospam-yahoo-com -, 2007-02-15 07:16 PM


Related issues

Related to QGIS Application - Bug report #19746: Disappearing -180 / 180 longitude grid lines on certain z... Open 2018-09-01

History

#1 Updated by hamish_nospam-yahoo-com - over 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

#2 Updated by hamish_nospam-yahoo-com - over 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

#3 Updated by Gavin Macaulay - over 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

#4 Updated by Giovanni Manghi over 15 years ago

Replying to [comment:3 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.

#5 Updated by Giovanni Manghi over 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?

#6 Updated by Otto Dassau over 15 years ago

  • Status changed from Open 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

#7 Updated by Markus Neteler about 13 years ago

  • Assignee deleted (nobody -)
  • Pull Request or Patch supplied set to No
  • Resolution deleted (fixed)
  • Operating System deleted (Debian)
  • Must fix changed from No to yes
  • Target version changed from Version 1.2.0 to Version 1.7.1
  • Priority changed from Low to High

QGIS 1.7.0 still suffers from the absence of global wrap around.

The "trick" to move the world to the 0...360° space is not compliant with other GIS nor our other GIS data.
The global wrap around code is tricky, see http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/lib/gis/plot.c and http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/lib/gis/wind_overlap.c for the implementation in GRASS, perhaps useful for inspiration.

#8 Updated by Giovanni Manghi about 13 years ago

Hi Markus, do you want this ticket to be reopened?

Markus Neteler - wrote:

QGIS 1.7.0 still suffers from the absence of global wrap around.

The "trick" to move the world to the 0...360° space is not compliant with other GIS nor our other GIS data.
The global wrap around code is tricky, see http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/lib/gis/plot.c and http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/lib/gis/wind_overlap.c for the implementation in GRASS, perhaps useful for inspiration.

#9 Updated by Andreas Neumann about 6 years ago

  • Related to Bug report #19746: Disappearing -180 / 180 longitude grid lines on certain zoom levels added

Also available in: Atom PDF