Can you turn a .pdf into a map layer? How?

Take command of air and naval assets from post-WW2 to the near future in tactical and operational scale, complete with historical and hypothetical scenarios and an integrated scenario editor.

Moderator: MOD_Command

Post Reply
User avatar
Mgellis
Posts: 2162
Joined: Sat Aug 18, 2007 2:45 pm
Contact:

Can you turn a .pdf into a map layer? How?

Post 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?

User avatar
brassem
Posts: 72
Joined: Wed Oct 02, 2013 3:38 am
Location: NE of YMML

RE: Can you turn a .pdf into a map layer? How?

Post 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!
i7-3930K@3.2Ghz&H100liquid|ASUSP9X79Deluxe>X680/OC|32GBGSkillPC2400|2TBRaid0|Antec1200&1200WTruePower|ASUSGV278H-3D|SBX-FiT-Pro|TurtlebeachDPX21|Win7-64U
mikmykWS
Posts: 7185
Joined: Tue Mar 22, 2005 4:34 pm

RE: Can you turn a .pdf into a map layer? How?

Post 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
User avatar
brassem
Posts: 72
Joined: Wed Oct 02, 2013 3:38 am
Location: NE of YMML

RE: Can you turn a .pdf into a map layer? How?

Post by brassem »

Much better advice!
i7-3930K@3.2Ghz&H100liquid|ASUSP9X79Deluxe>X680/OC|32GBGSkillPC2400|2TBRaid0|Antec1200&1200WTruePower|ASUSGV278H-3D|SBX-FiT-Pro|TurtlebeachDPX21|Win7-64U
User avatar
Mgellis
Posts: 2162
Joined: Sat Aug 18, 2007 2:45 pm
Contact:

RE: Can you turn a .pdf into a map layer? How?

Post 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.
User avatar
Mgellis
Posts: 2162
Joined: Sat Aug 18, 2007 2:45 pm
Contact:

RE: Can you turn a .pdf into a map layer? How?

Post 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.
User avatar
Blu3wolf
Posts: 198
Joined: Mon Sep 30, 2013 1:09 pm
Location: Western Australia
Contact:

RE: Can you turn a .pdf into a map layer? How?

Post 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!


Image



the street maps are lower file size. hence, less crashes.
To go up, pull back on the stick.
To go down, pull back harder...

Speed is life. Altitude is life insurance.
Tomcat84
Posts: 1952
Joined: Wed Jul 10, 2013 5:13 pm

RE: Can you turn a .pdf into a map layer? How?

Post 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.
My Scenarios and Tutorials for Command

(Scenarios focus on air-warfare :) )
User avatar
Mgellis
Posts: 2162
Joined: Sat Aug 18, 2007 2:45 pm
Contact:

RE: Can you turn a .pdf into a map layer? How?

Post 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.

User avatar
Anathema
Posts: 93
Joined: Fri Oct 04, 2013 8:51 pm
Location: Australia

RE: Can you turn a .pdf into a map layer? How?

Post 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.
smudge56
Posts: 667
Joined: Sat Jan 17, 2009 8:31 am
Location: UK

RE: Can you turn a .pdf into a map layer? How?

Post by smudge56 »

Nice overlat blu.
AKA - Smudge
Post Reply

Return to “Command: Modern Operations series”