Page 1 of 1
Can you turn a .pdf into a map layer? How?
Posted: Thu Dec 12, 2013 7:27 pm
by Mgellis
A truly wonderful site, the Perry-Castaeda Library Map Collection, which is at...
http://www.lib.utexas.edu/maps/
...has thousands of maps available for free download. Many of them would be suitable for Command map layers, IF there was a way to turn a .pdf into a map layer.
For example, here's a map of part of Haiti...
http://www.lib.utexas.edu/maps/world_ci ... 3-1994.jpg
The detail is wonderful. You can see geographic features, individual buildings are marked, etc. The site provides access to thousands of maps like this. It's a lot of fun to just browse.
Is there a way to turn this kind of map .pdf into a map layer for Command? Does anyone know how to do this?
RE: Can you turn a .pdf into a map layer? How?
Posted: Fri Dec 13, 2013 9:54 pm
by brassem
The only way that I know of to "convert" a "Portable Document Format" file to a graphic file format is to view the PDF and hit the "Print Screen" key to save the content into memory. Then open your favourite image processing program and paste the content into a new file.
The "Print Screen" capture quality depends on your screen display resolution. If you have high screen resolution you get to capture more pixels. Then its a case of "stitching" your captures together to make up the required image. It takes a bit of effort. (There may be an app out there that does this but usually pdf's are locked for this very reason of securing their content.)
The site you listed has some excellent reference!
RE: Can you turn a .pdf into a map layer? How?
Posted: Fri Dec 13, 2013 10:10 pm
by mikmykWS
Mark you probably can't import a map in especially if the type isn't the same isn't georeferenced etc.
Take a look at GMAP though as there are wide range of imagery types you can bring in, including road maps etc.
Mike
RE: Can you turn a .pdf into a map layer? How?
Posted: Fri Dec 13, 2013 10:17 pm
by brassem
Much better advice!
RE: Can you turn a .pdf into a map layer? How?
Posted: Sat Dec 14, 2013 2:41 am
by Mgellis
ORIGINAL: mikmyk
Mark you probably can't import a map in especially if the type isn't the same isn't georeferenced etc.
Take a look at GMAP though as there are wide range of imagery types you can bring in, including road maps etc.
Mike
I like GMAP, although it seems to crash if you try to give it an area much larger than about five miles by five miles (and even that is pushing it). I was thinking that there are so many really nice maps available in .pdf online from the Perry-Castaeda Library Map Collection and it would be nice to be able to use them.
I did a bit of research and I suppose one could convert the .pdf to a .png file and then use the information in the map to create a .pgw file, but you would probably have to play around with the data, things like the exact coordinates, the meters-per-pixel ratio, etc. Even then, there would probably be some minor errors.
(The easiest method of all, although even less accurate, is to simply have Command open in one window and the .pdf map open in another, if it's a topographic one showing buildings, etc., and just make your best guess as to the exact position of each building, runway, etc. For a lot of things, of course, that's good enough--it doesn't really matter
exactly where the civilian hospital is...just make sure you don't hit it!)
Oh well, I figured it could not hurt to ask.
RE: Can you turn a .pdf into a map layer? How?
Posted: Sat Dec 14, 2013 2:50 am
by Mgellis
Quick follow-up...
I am finding that GMAP crashes less often when you use street maps or topographic maps rather than satellite imagery...and the image files that result are smaller and easier to load in Command.
RE: Can you turn a .pdf into a map layer? How?
Posted: Sat Dec 14, 2013 3:27 am
by Blu3wolf
it is the file size that is the problem.
if you dont mind wait times, you could probably get an entire continent in 17 zoom by making them multiple files... but the load time would be horrendous...
I use different zoom levels for different zooms. the facility itself - zoom level 17. nearby surrounds, 15 or 16. far surrounds, 13 or 14.
if and when I get around to photoshopping a gradient into each image, it should look nice!
the street maps are lower file size. hence, less crashes.
RE: Can you turn a .pdf into a map layer? How?
Posted: Sat Dec 14, 2013 8:05 am
by Tomcat84
Mgellis I experimented a bit yesterday with the Port au prince jpg. It's possible but you have to make your own pgw file, which is easy with the coordinates but tough to figure out the right scale factor. I dont know the exact math for that but with experimenting i still got reasonably close
As for pdfs, you should be able to open them with photoshop and save as png
and to get the pgw file right, one other idea i had besides experimenting, but havent tried yet, is to get the same area in Gmap, resize your png to the same size as what gmap produces and work with its pgw file.
and in all cases it's important to know coordinates I would say.
RE: Can you turn a .pdf into a map layer? How?
Posted: Sat Dec 14, 2013 12:02 pm
by Mgellis
ORIGINAL: Blu3wolf
it is the file size that is the problem.
if you dont mind wait times, you could probably get an entire continent in 17 zoom by making them multiple files... but the load time would be horrendous...
I use different zoom levels for different zooms. the facility itself - zoom level 17. nearby surrounds, 15 or 16. far surrounds, 13 or 14.
the street maps are lower file size. hence, less crashes.
Hmmm...I didn't realize you could use different zoom levels like 15 or 16. In fact, that might work better for me. I'm mostly interested in GMAP and overlays to get the correct placement of buildings, docks, etc. In fact, I normally take the overlay out once I've got the buildings placed. So for me, the time involved in generating the overlay and then loading it is one of the important factors. And, as I said, there are so many nice maps available at various sites, especially topographic ones, which often list the exact location of things like "water treatment plant," etc., that it would have been nice to just set those up as overlays.
RE: Can you turn a .pdf into a map layer? How?
Posted: Sun Dec 15, 2013 7:25 am
by Anathema
I don't think anyone mentioned it, but if you have a proper full version of Acrobat then you can often edit PDF files and considering it is a 2D map, you could probably even copy all of the vector shapes out into Illustrator or any program that you like. I am not sure of any open source alternatives, but I presume there is one.
Normally if you wanted to match images in CG, you place them on seperate layers and then set the layer mode to difference, which allows you to line them up because the resulting image will turn black when they are perfectly matched (eg 0 difference in RGB values). However this isn't going to work with a map and photo too well, but you could try using the grid lines to try and render a satellite image to match at least part of the map. Or you could also try to copy the road vectors out of the PDF map and them match them up using the difference method, which would let you figure where to place and how much to scale the entire map.
Otherwise a more complicated solution would be to use an open source GIS program like QGIS to produce a georeferenced map image in the correct format, or to import, georeference and finally convert an existing map into the correct format. You could even import the satellite image and render out a map/satellite image composite, adding your own details to it, if that is what you wanted to do.
RE: Can you turn a .pdf into a map layer? How?
Posted: Sun Dec 15, 2013 11:34 am
by smudge56
Nice overlat blu.