Opened 8 years ago

Last modified 7 years ago

#2492 new defect

v.generalize: incorrect handling of wrap at 180 meridian

Reported by: jkaplan Owned by: grass-dev@…
Priority: normal Milestone: 6.4.6
Component: Vector Version: svn-trunk
Keywords: v.generalize Cc:
CPU: OSX/Intel Platform: All


I am running GRASS 7.1.svn on Mac OS X.

GRASS 7.1.svn (global_lonlat):~ > g.version -g

I am having a problem with the behavior of v.generalize when attempting to generalize a vector feature - lines or polygons it does not seem to matter - that crosses the 180 meridian, using a location that is EPSG:4326 with global extents.

The problem is probably best illustrated with a picture, which I have attached to this ticket, but can also be viewed here:

In the picture two line vector features are displayed. The black-lined feature is the original vector line feature (test1). The red-lined feature is produced from test1 using the following command:

v.generalize input=test1 output=test2 method=sliding_averaging look_ahead=5 slide=1 threshold=1

It appears that v.generalize, when smoothing between vertices that are very close to the 180 meridian, results in the incorrect identification of the “next" point, hence the long horizontal lines connecting points “the wrong way around” the earth. The behavior is the same when using any of the generalization or smoothing tools.

I have tested this with a simpler vector containing points farther away from the 180 meridian and it doesn’t appear to show the same behavior.

I would very much appreciate any help anyone could give me to solve this problem.

Thank you in advance!

Best regards,

Jed Kaplan


If you would like to download the original lines file and try my procedure yourself, I have also attached a test vector file to this ticket. It can also be downloaded here:

Assuming you have OGR support for GMT in your version of GRASS, you can import the vector using this command: dsn=GRASS_wrap_problem_samplevector.gmt output=test1

Attachments (2)

GRASS_wrap_problem.png (109.4 KB ) - added by jkaplan 8 years ago.
Example of erroneous v.generalize output
GRASS_wrap_problem_samplevector.gmt (19.3 KB ) - added by jkaplan 8 years ago.
Sample vector lines object in OGR_GMT format

Download all attachments as: .zip

Change History (3)

by jkaplan, 8 years ago

Attachment: GRASS_wrap_problem.png added

Example of erroneous v.generalize output

by jkaplan, 8 years ago

Sample vector lines object in OGR_GMT format

comment:1 by martinl, 7 years ago

Milestone: 6.4.6
Note: See TracTickets for help on using tickets.