GPSFileDepot Forums

General Category => Map Making Support => Topic started by: AgentDBCooper on September 28, 2018, 05:48:26 AM

Title: Ontario Atlas Map
Post by: AgentDBCooper on September 28, 2018, 05:48:26 AM
Hey guys,

I was wondering if there is a way I can export chunks of map from this resource and upload to Google Earth, or Basecamp, or a Garmin device?
h*******p://www.gisapplication.lrc.gov.on.ca/CLUPA/Index.html?site=CLUPA&viewer=CLUPA&locale=en-US

The Atlas doesn't work well on mobile device, so I'm always stuck printing out pages, which isn't ideal, when I have an awesome GPS device waiting to be used.

Any ideas? Thanks!
Title: Re: Ontario Atlas Map
Post by: jolly47roger on September 28, 2018, 07:37:15 AM
If only the PDFs were GeoReferenced, then it would be easy.

The workflow would be:

1. Download a PDF
2. Identify coordinate points for georeferencing (see below)
3. Georeference the PDF by matching points to coordinates
4. Crop the collar to just leave the map detail
5. Cut the map into 1Mpixel pieces to make a KMZ for Google Earth and/or a Garmin Custom Map.

If you can match enough highway bends/junctions, lakes or other landmarks then this technique with MAPC2MAPC may work :
http://www.the-thorns.org.uk/mapping/GEcalibrate.pdf  (http://www.the-thorns.org.uk/mapping/GEcalibrate.pdf)

MAPC2MAPC (with GDAL) will do the rest.

But I declare an interest as the author of MAPC2MAPC!
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 01, 2018, 06:45:53 AM
Quote from: jolly47roger on September 28, 2018, 07:37:15 AM
If only the PDFs were GeoReferenced, then it would be easy.

The workflow would be:

1. Download a PDF
2. Identify coordinate points for georeferencing (see below)
3. Georeference the PDF by matching points to coordinates
4. Crop the collar to just leave the map detail
5. Cut the map into 1Mpixel pieces to make a KMZ for Google Earth and/or a Garmin Custom Map.

If you can match enough highway bends/junctions, lakes or other landmarks then this technique with MAPC2MAPC may work :


MAPC2MAPC (with GDAL) will do the rest.

But I declare an interest as the author of MAPC2MAPC!

Whao.. none of that sounded like English to me. xD xD

Yes, the PDF it exports is pretty difficult to use. I was hoping there would be a third party tool to export a certain layer I can then use as an overlay somewhere else.

Clearly a little over my head. Can you refer me to a tutorial, or something that might help me understand the words that you just said?

Thanks!
Title: Re: Ontario Atlas Map
Post by: jolly47roger on October 01, 2018, 10:07:36 AM
I'm not aware of a third party tool - but I don't know everything.

pMail me and I will try to walk you through it.

But it can be done using push-pins to supply the coordinates.

Example here : www.the-thorns.org.uk/Landscape.kmz (http://www.the-thorns.org.uk/Landscape.kmz)
Title: Re: Ontario Atlas Map
Post by: Pooneil on October 01, 2018, 07:00:08 PM
You could handle the whole thing in the open source GIS package, QGIS.  It'll take a bit of work to learn how, but you can output nice geolocated PDF maps or geo tif files that can be converted into KMZ. 

https://www.qgis.org/
Title: Re: Ontario Atlas Map
Post by: Boyd on October 02, 2018, 03:45:04 AM
Here's a simple tutorial for making "Garmin Custom Maps". Garmin devices can only use images that are a maximum of 1024x1024 pixels however, which is a big limitation. However, you can have multiple .kmz files of that size, so you can break a larger image into individual "tiles". You could use a program like Photoshop to make the tiles.

Basecamp doesn't have a limitation like this however, so if you only want to use the map on your computer the image can be as large as you want.

https://www.garmin.com/us/products/onthetrail/custommaps
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 03, 2018, 09:07:34 AM
Turning PDFs to kmz for my garmin is something I do on a very regular basis.  For some reason I'm insane enough to enjoy it.
If you have a PDF that you would like in your garmin as a custom map, I would be happy to try to convert it for you, or even talk you through the process I use if you would like to learn.

Jeff
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 06:51:15 AM
Quote from: MojaveMan on October 03, 2018, 09:07:34 AM
Turning PDFs to kmz for my garmin is something I do on a very regular basis.  For some reason I'm insane enough to enjoy it.
If you have a PDF that you would like in your garmin as a custom map, I would be happy to try to convert it for you, or even talk you through the process I use if you would like to learn.

Jeff

Thanks Jeff! And everyone who took the time to reply.

I'm going to slowly learn the process of doing this, but I would greatly appreciate your offer to help me make a map. As of right now, there is only a relatively small piece of Crown Land that I would like mapped for my Garmin. I'll attached it right now as a PDF.

The two plots that are yellow are said Crown Land. It's important that I never cross the lines into private property. Having the Crown lines overlay Google Maps, or OSM map for Garmin, would be gold to me.

Again, thank you!
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 07:43:09 AM
This map looks really very small and should not be difficult to convert into a custom map.  I would like to stress that such a trivial thing as a few rectangles are probably more suited to the more "normal" way where you end up with a .img file for the garmin.
We are going to end up with a .kmz file that GoogleEarth uses, and place it in the "\Grmin\Custom Maps" directory on the unit (or on its memory card, if you have one).

So, step one is to convert it to an image.  For this I will use a free graphics manipulation tool called imagemagick.  I use this to convert and manipulate the images (for example, to convert from UTC to Lat/Lon I run it through a distortion using imagimagick).  For your .pdf, I suspect all we will need to do is convert it to a .jpg.

After playing with a few options, here is the command I used:
convert +antialias -colorspace sRGB -density 200 .\Landscape.pdf map200.jpg

I determined that the provided PDF seems to be an image that is already antialiased, so I turned off antialiasing (I know, that + makes it look like I'm trying to add it).
I played with various DPI settings and found 200 to be "adequate".  Going up to 300 didn't help any - this pdf is not a terribly high quality image.
I'm attaching the resulting file.
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 07:44:16 AM
So, the next step is to use GoogleEarth to georeference the file and create the .kml.
In order to do that, we need to have an idea of where on the earth this location is.  Can you give me a hint?

Ok, I found the location of interest, and did my best to georeference the file.  There does appear to be some minor differences (like the roads are not *exact*), but what I have done should place the most precision around those yellow boxes you are concerned about.

So I'm attaching the map in .kmz format.  You can look in google earth to see if this meets your standards, but DON'T put it in your garmin yet.

EDIT
I made a second attempt at georeferencing, and think this second one (map2.kmz) may be a bit better.
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 08:08:57 AM
Step 3 is to consider the size of the map file and tile the map.  We want to wait to do this until you are happy with the map as it is.  So, can you take a peek in Google Earth and make sure you like it?
Once you are happy, we need to cut the big map file into little tiles that the garmin can use.  I have written a script to do this, but there are many online tools that will do it too...
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 08:09:25 AM
44.97393333129668, -75.84388328135792

These are coordinates to a spot I pinned while there. Does that work?
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 08:19:35 AM
Quote from: MojaveMan on October 06, 2018, 08:08:57 AM
Step 3 is to consider the size of the map file and tile the map.  We want to wait to do this until you are happy with the map as it is.  So, can you take a peek in Google Earth and make sure you like it?
Once you are happy, we need to cut the big map file into little tiles that the garmin can use.  I have written a script to do this, but there are many online tools that will do it too...


Yes! Let's have a peek! :)
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 08:50:48 AM
Quote from: AgentDBCooper on October 06, 2018, 08:19:35 AM

Yes! Let's have a peek! :)

Do you know how to view the .kmz I provided in Google Earth?
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 09:05:27 AM
Quote from: MojaveMan on October 06, 2018, 08:50:48 AM
Quote from: AgentDBCooper on October 06, 2018, 08:19:35 AM

Yes! Let's have a peek! :)

Do you know how to view the .kmz I provided in Google Earth?

Definitely. I have the desktop version installed. I can do that much! xD
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 09:44:36 AM
Quote from: AgentDBCooper on October 06, 2018, 09:05:27 AM
Quote from: MojaveMan on October 06, 2018, 08:50:48 AM
Quote from: AgentDBCooper on October 06, 2018, 08:19:35 AM

Yes! Let's have a peek! :)

Do you know how to view the .kmz I provided in Google Earth?

Definitely. I have the desktop version installed. I can do that much! xD

So, do you think the provided .kmz file is "close enough" for your needs?

I have not seen a reply from you, but I pretended for a moment that you were happy with that, so I went ahead and tiled it.
I'm attaching it here, and you can put it on your garmin in the "/Garmin/CustomMaps" folder.  Then you may have to enable custom maps on the garmin.  See here for help with that:
https://www.garmin.com/us/products/onthetrail/custommaps

Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 12:31:12 PM
Quote from: MojaveMan on October 06, 2018, 09:44:36 AM
Quote from: AgentDBCooper on October 06, 2018, 09:05:27 AM
Quote from: MojaveMan on October 06, 2018, 08:50:48 AM
Quote from: AgentDBCooper on October 06, 2018, 08:19:35 AM

Yes! Let's have a peek! :)

Do you know how to view the .kmz I provided in Google Earth?

Definitely. I have the desktop version installed. I can do that much! xD

So, do you think the provided .kmz file is "close enough" for your needs?

I have not seen a reply from you, but I pretended for a moment that you were happy with that, so I went ahead and tiled it.
I'm attaching it here, and you can put it on your garmin in the "/Garmin/CustomMaps" folder.  Then you may have to enable custom maps on the garmin.  See here for help with that:
https://www.garmin.com/us/products/onthetrail/custommaps

WHAO! That's awesome! It looks perfect!

Is there any way everything else except the yellow part can be cropped out?

I'm reading through the link you provided right now.. definitely something I can wrap my head around.
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 12:41:24 PM
The short answer is yes, but what you want would be better accomplished by a "vector map" as opposed to a "raster map".  We just did a raster map - we took an image and slapped it onto the map.  A "vector map" would place just the rectangle right where you want it.
You can, however, take that .jpg and edit it in any way you want, and place it into Google Earth.  So if you take the .jpg I first made and cut away all the parts you don't want, then you could load it into Google Earth and georeference it and create the .kmz for your garmin.  You can do that with any image you like - the fact that the image resembled the underlying terrain is mere coincidence.
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 12:42:26 PM
I think I'm making some progress here...

One question though.. how exactly do you get the scale to match between my image file and Google Earth? Can I input custom scale? If that even makes sense.

For example, the PDF I printed off the site, then converted into a JPG, I cropped, is scaled at 1:25,549. How do I match that with Google Earth? Do you eye ball it?
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 01:04:19 PM
I'm getting real close!!

I'm using the Transform function of the overlay to stretch and getting the lines to fit. Super tricky.. or I'm not well practiced. Clearly. But it's starting to look like something!
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 01:33:49 PM
Quote from: AgentDBCooper on October 06, 2018, 12:42:26 PM
I think I'm making some progress here...

One question though.. how exactly do you get the scale to match between my image file and Google Earth? Can I input custom scale? If that even makes sense.

For example, the PDF I printed off the site, then converted into a JPG, I cropped, is scaled at 1:25,549. How do I match that with Google Earth? Do you eye ball it?

Yeah, so there is no "scale" you have to worry about.  For maps without any control markings, my procedure goes something like this:
- in the Places tree, add a "image overlay" and use your image for the overlay
- drag the 4 corners of the image around the map manually
- rotate the image if necessary
- repeat until you have something close
- zoom waaaaay in to a corner and find some feature of the map image that you can match to the background and drag the image to match it.  The corners and the exact middle of the image are best for this
- zoom into the opposite corner and see if you can lock it into place
- check the center of the image, and all 4 corners
- lather, rinse, repeat

Its a very iterative process, complicated if the image requires rotation.  You can NOT apply a rotation to a Garmin Custom Map, but you can use Google Earth to figure out what rotation is required and use imagemagick to rotate the image.  You then use that rotated image in the Custom Map.
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 02:01:00 PM
Wow. One could really go insane doing this..
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 02:16:44 PM
Quote from: AgentDBCooper on October 06, 2018, 02:01:00 PM
Wow. One could really go insane doing this..

One can really go insane with a map with a matching projection.
Most map images I use have a different projection, adding an entire second level of insanity.
If I knew how to add maps here, I would add my latest - a map of the Fresno area of Big Bend State Park.  Its *huge*....
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 06, 2018, 03:14:44 PM
Thanks man! Really appreciate your time! Now that it's not as intimidating, it'll just be a matter of practice. Like anything else.
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 06, 2018, 05:01:04 PM
Don't forget, you have to "tile" the image before copying it over to your Garmin.  There are programs out there to do it for you...they tend to screw up the compression on the jpg, so be careful.
I used OKMap for this example....
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 08, 2018, 05:41:14 AM
Fuuuuuuuuuuuuuuuuuuu!

Took me forever to finally get the damn thing aligned nicely, saved a kmz and tried to make my own map in Google Maps, but it won't load the kmz file. "1 row couldn't be shown on the map". Do I have to tile it for Google Maps as well?

Is tiling required in order to break the map down into the 1024x1024 resolution for Garmin devices? What's the purpose of tiling? Is this essentially just cropping the image into smaller puzzle like pieces? Can I do this with Photoshop?
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 08, 2018, 07:45:14 AM
I'm a little bit confused about your statement that you made a .kmz and tried to load it into Google Earth.  Generally, you *make* the .kmz with google earth.  What are you creating the .kmz with?

Quote from: AgentDBCooper on October 08, 2018, 05:41:14 AM
Is tiling required in order to break the map down into the 1024x1024 resolution for Garmin devices?

Yes, the 1024x1024 tile is a Garmin "limitation".  Garmin used to have a page detailing these limitations, but for some reason I'm having trouble pulling it up at the moment.  You could google "Garmin Custom Map limitations" to read more.

The general idea is to follow these steps:
- find a map you like
- convert the map to .jpg and into the projection that GoogleEarth likes (this is where I have spent much time and effort)
- georeference the map by creating an Image Overlay in Google Earth (generally easy if your map has control points)
- export that image overlay as a .kmz
- use a "map tiler" to cut that image into a bunch of tiles that will automatically georeference each tile for you based on the larger image
- copy that "tiled" .kmz into your CustomMaps folder

I did provide you with a tiled .kmz in this thread, if you wanted to check it out.

I did find that many tilers were hosing my carefully crafted images (adding compression artifacts to the image), so be careful.
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 09, 2018, 04:44:02 AM
Quote from: MojaveMan on October 08, 2018, 07:45:14 AM
I'm a little bit confused about your statement that you made a .kmz and tried to load it into Google Earth.  Generally, you *make* the .kmz with google earth.  What are you creating the .kmz with?

Quote from: AgentDBCooper on October 08, 2018, 05:41:14 AM
Is tiling required in order to break the map down into the 1024x1024 resolution for Garmin devices?

Yes, the 1024x1024 tile is a Garmin "limitation".  Garmin used to have a page detailing these limitations, but for some reason I'm having trouble pulling it up at the moment.  You could google "Garmin Custom Map limitations" to read more.

The general idea is to follow these steps:
- find a map you like
- convert the map to .jpg and into the projection that GoogleEarth likes (this is where I have spent much time and effort)
- georeference the map by creating an Image Overlay in Google Earth (generally easy if your map has control points)
- export that image overlay as a .kmz
- use a "map tiler" to cut that image into a bunch of tiles that will automatically georeference each tile for you based on the larger image
- copy that "tiled" .kmz into your CustomMaps folder

I did provide you with a tiled .kmz in this thread, if you wanted to check it out.

I did find that many tilers were hosing my carefully crafted images (adding compression artifacts to the image), so be careful.

Sorry I wasn't very clear.

In Google Earth desktop, I imported the image as an overlay. Once I got it all aligned, I exported an KMZ file and then went into Google Map on Chrome, tried to create a custom map with this KMZ file, figured the overlay would appear. It doesn't. I get that error message I mentioned. I figured that I should just work between Google Earth and Google Maps. No? I haven't even begun the process of making it Garmin compatible.

Your instructions here will be helpful for sure. Just not sure why I can't load it into Google Maps, I can can view the overlay I added on my Android device.
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 09, 2018, 06:49:47 AM
Sorry, I have no experience in using the Map web app with .kmz.  I only use Google Earth.
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 10, 2018, 09:07:31 AM
Do you use your maps on your smartphone? Using the Google Earth app? Or do you use it only on GPS device?
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 10, 2018, 12:11:33 PM
Just the GPS.  All of my efforts have the end goal of a pretty map showing up in my trusty Garmin - I'm not a fan of using a smartphone as a GPS device in the back country - or any other country, for that matter :)
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 11, 2018, 06:44:09 AM
Nice. Perhaps I should just forget Google Maps and just go straight from Google Earth to my Garmin.

What device do you use? I'm out in the sticks all the time, and to be honest, I'm not sure if I would trust my Garmin Fenix 5x. I've never really gambled with using it. Garmin has been f***ing with the software so much, nothing feels consistent anymore. What do you think about the wearable stuff by Garmin?
Title: Re: Ontario Atlas Map
Post by: MojaveMan on October 11, 2018, 07:40:44 AM
I have an eTrex20 (with the buttons torn off - man, that made me mad) and an Oregon 600.  With my penchant for Custom Maps, the 500 tile limit of the 600 is really nice.
If I were on the market today, I would probably consider the newer eTrex models - maybe a 20x or a Touch25 (few buttons to tear off).  I imagine with the smartphone being so prevalent, the dedicated hand-held GPS device will be a thing of the past soon...so I might grab me one before they disappear.
Title: Re: Ontario Atlas Map
Post by: AgentDBCooper on October 12, 2018, 04:48:16 AM
Good idea..