GPSFileDepot.com
 

News:

Welcome to GPSFileDepot!

Main Menu

Simplifying World Map

Started by Brek, January 22, 2017, 05:16:55 PM

Previous topic - Next topic

Brek

Greetings from Australia folks :) This is my first post here.

My question relates specifically to the World topo map available here,
of which I think there is only one. It comes in two packages for East and West parts of the world.

I'm writing GPS software for a relatively small screen, and was hoping to use this world outline for a basemap.
I have stripped the low zoom image down with Cgpsmapper to just the line type 0x15
(for shorelines), so it's just the simple continent outlines that are left on the map.

The problem is the map is still far too detailed, and I was hoping there's a way in Cgps mapper, to lower it's resolution (number of points) automatically.
I have found a feature called "Generalise" which does that, but not significantly,
and you can only use it once on a map. There are still a few tens of thousands of lines.

One obvious way would be to retrace the map with simpler lines, or to delete a bunch of existing points,
but it would be ideal if there was an automated way.
Any ideas appreciated.
Cheers, Brek.


Brek

Ok, well it appears Cgpsmapper doesn't have the feature, but I've written a program to
process the mp file that Cgpsmapper produces.
When parsing any line element, I included the first point in the line, and then only included
one in every five points, until the last point which is always included.

This would normally work a treat, but for the world map, some extra bodge is needed because
it appears to be automatically produced using a raster map as the source.
There are a large number of little lines with only two or three points all abound the continents,
so I also excluded any line with only two or three points.


popej

Cgpsmapper supports header option for controlling line simplifying, from manual:

SimplifyLevel=n

Simplify level for Douglas-Peucker simplification algorithm. The higher value, the less simplification is done. It is
important to note, that with high value, gridding (limitation coming from the format) might be visible.
Default = 1
Valid range is from 0.1 up to 10

I think you should turn on generalization with option PreProcess=x. I'm not sure how it works for lower resolutions, hopefully simplification value is adjusted accordingly.

Boyd

Quote from: Brek on January 22, 2017, 05:16:55 PMI'm writing GPS software for a relatively small screen, and was hoping to use this world outline for a basemap.

This map? https://www.gpsfiledepot.com/maps/view/301/ ? Do you have the author's permission to use it for this purpose? Just because a map is free does not mean that it's open source. See the gpsfiledepot usage policy here: https://www.gpsfiledepot.com/usage.php

"Maps downloaded from GPSFileDepot may not be resold or re-distributed without express written permission from the map author. Additionally, many maps have been created using a version of cgpsmapper that does not allow for commercial application (selling) of these maps. Do NOT download and redistribute or sell maps from GPSFileDepot."

Brek

#4
Hi Boyd,
Yes, that’s half of the World map, and there’s another half to complete it.
I assume they are hosted here to be downloaded, and used on a Garmin GPS,
so what’s the difference if I use it on my own GPS?
Someone else might use it with Cgpsmapper since I believe that has a positioning function if you have a GPS mouse connected to a laptop.

Hi popej,
I wish I’d known earlier :D
I don’t think it’s going to matter in future. I wouldn’t want to do this to any detail map.
Just the World map is not intended to be zoomed into detail.
It probably would have been better though. There’s no brains behind skipping ever x number of points,
but for a world map at very high zoom, I don’t think any difference would be perceived.

Back to the other thing...
I would like to distribute a few sample map tiles in future, but I’m far from that stage yet.
I’d like to get in touch with “RoboMatt” who made the Garmin Yosemite too hosted here.
I’m only talking about a small tile cut out of that, have either of you any way to contact him?
I couldn’t see any posts here for that name.
This world map, I’m not satisfied to stick with that data for any future stuff.
If it came to it I’d trace from a world map to get a single clean line around
continents because the screen is so small.

If or when it does come to distribution of any of my software, sample tiles would be nice,
but aren’t required.
The program that I used to simplify the world map is the same that does the pre-process for my GPS.
The user could do that themselves.
Cheers, Brek.

Boyd

You said you were " writing GPS software" so I assumed that meant you were creating something you were going to offer for download. Sorry if that was wrong. Nevertheless, it has always been the policy of this site not discuss ways to modify the work of another author without their permission.

Why not send maps4gps a PM? He would have all the source files and that could make things easier for you, assuming that he doesn't object.

Brek

#6
Hi again,
I don’t think the source data for the world map can be made clean any easier than starting
with some other data. I do think it’s robotically produced from image data,
or the continent edges wouldn’t be the way they are.
You can see what I mean by simply choosing any continent of the overall map image,
and zooming in as far as you can to any coastline.
There are many areas made up of many small lines, many of which are just
a few points long. That presents problems in my situation when you zoom out far enough.

Cgpsmapedit deals with this somehow by not drawing small lines at very low zoom.
When you view the whole world, a lot of small islands become invisible.

The GPS project is both software and hardware. So far I haven’t found anyone in the world
who has completed a vector mapping GPS down to chips and wire.
There’s nobody to distribute the maps to ;) It performs similar to Garmin eTrex Legend.

If I do not make these modifications the world map displays as a complete mess.
You can see the difference between the World and Yosemite topo. The Yosemite too is made
of single clean lines that display that way. Even getting the world down to approx 300Kb,
it’s still pretty messy. The Yosemite data is unmodified.
















Brek

Ah crap! if they are too big go ahead and delete them :D

Boyd

That is a very cool project!  8)


-Oz-

Dan Blomberg
Administrator - GPSFileDepot
GPS Units: Garmin Dakota 20, Garmin GPSMap 60csx, Nuvi 255W, Nuvi 250W, ForeRunner 110, Fenix 2, Tactix Bravo, Foretrex 401
See/Download My Maps!

Brek

Hi.. Thanks guys :)
There’s a bit of a demo of it in action here: https://www.youtube.com/watch?v=qEyZdGWASl8
That’s a bit of time ago, I’ve since done map rotation to bearing, and speed improvements, etc.
There are other videos surrounding it that would bore anyone to tears unless into electronics/programming.

The idea for the world map is to replace the file browser for detail maps.
As anyone here would know you select a detail map by zooming into a large area map,
and the detail map for the area is selected so the user never deals with a file browser.

The next one I want to do with colour OLED display, mainly so the MP3 player can display cover art,
but first things first.

RoboMatt... I’ve had no luck finding him. Might have to look for another sample map file.