PDA

View Full Version : Google Maps API to display your maps?



guyanonymous
03-27-2009, 08:44 PM
I stumbled across a program that chops up your huge huge images and creates the code to use the Google Maps API to display them just like a Google Map.

You can scroll, zoom, drag, everything. All with about 5 clicks.

I uploaded my first test here in case anyone wants to see it in action.

http://www.davidpiercey.com/test/

The program I used was from here:

http://www.casa.ucl.ac.uk/software/googlemapimagecutter.asp

torstan
03-28-2009, 12:04 AM
That's brilliant! Love it. Thanks for the link.

guyanonymous
03-28-2009, 12:17 AM
That was a 10000 px width image....I'm trying it with a 40000 px width in a bit (that's slowing my computer down a bit).

Now to figure out how to make links on the map and other markers (borders, areas, etc)...

torstan
03-28-2009, 12:24 AM
When you figure that out, please let me know. That would be great.

guyanonymous
03-28-2009, 12:31 AM
1px->1km would then be possible on for world maps covering planets with 6000+km radii.

philipstephen
03-28-2009, 03:56 AM
I've downloaded the program and am working on figuring it out now.

good to see another vancouver photographer spending time on some classic geek pursuits!

phil

guyanonymous
03-28-2009, 04:09 AM
Right back at you!

I just had a peek at your site. I really enjoy your many types of art and creation.

If you want to see some amazing ink work, you might enjoy the book Who Needs Donuts? (http://www.amazon.ca/Needs-Donuts-Mark-Alan-Stamaty/dp/0375825509)

Workign with a layered 40000x30000px image is slow. Just realized after starting a 20 minutes save as TIF that that program doesn't read TIF.

guyanonymous
03-28-2009, 04:11 AM
Hmm...above 30000 pixels PS doesn't like saving as much other than TIF and PS formats. Now...what do I have to convert a massive TIF to a bmp?

Ascension
03-28-2009, 04:31 PM
This looks awesome...I love doing huge maps and this will be a lot of fun to play with.

guyanonymous
03-28-2009, 04:42 PM
I've been banging my head against the wall this morning. The software doesn't want to load 30000px wide bmp files...so now I'm trying smaller. I'll let you know how it works out.

My ideal (in case there's a wonderful programmer out there) is to be able to input, for example, 4 files making up one larger map and have that all work together. I could do each separately, but then they don't correspond to the naming structure etc that would be required to show them all together.

guyanonymous
03-28-2009, 06:18 PM
I had some frustrations with file sizes. It would seem that major slow-downs and/or problems loading the files occur when my antivirus is running. I turn it off, and the bmps load quickly. I'm wondering if it's chocking trying to scan a 2 GB file. I have found that, when loading a file, the menu bar grays out and the File/Processing/Help become inactive if it's loading properly; if it's not working, it just stays the same and nothing changes.

Anyway, my resolution tests:

40000 px width -> can output in jpg/bmp/png format
30000 px width -> doesn't even try to load it (?)
29999 px width -> doesn't even try to load it (?)
25000 px width -> loads fine (WITH Antivirus OFF)
20000 px width -> loads fine (WITH Antivirus OFF)
15000 px width -> loads fine (takes about 20x longer with antivirus ON)
10000 px width -> loads fine

In the batch file (GMapImageCutter.bat) I adjusted the memory allocated to the jar file to 2048M and 4096M respectively. I'm not sure if this has anythign to do with the above loading limitations or not - but I thought I change them from the default values 1/4 the size in case it helped.

My latest attempt (http://www.davidpiercey.com/test) is from a 25000px * 18229px BMP file (~1.3 GB file). If printed at 300dpi, this would come out at 83.33" x 60.76". I could live with that. Each pixel would represent ~4km square for the map scale I'm using. That means my rivers are way too wide as seen, are way too wide, but that's fine with me in this case. It's a balance of appearance and potential realism in my view.

I selected a zoom level of 8 which appears to create 21845 tiles used to create the image at its different zoom levels.

It took ~12 minutes to generate the tiles and html file.

This attempt was, in addition to testing maximum resolution, a test to see which font sizes would work/be legible when zoomed in. As a result, youll see a number of text groupings all over the map. Each group contains the font Papyrus at 1 to 100 pts in size. For my purposes, the 2.5 is the minimum I'd use with 100% clarity. 2 is legible, but I'll try to avoid using it. This will allow me to label fairly small details, etc. which makes me quite happy.


The link to view this version is:Abebe - 25000px x 18229px Map with Text size test (http://www.davidpiercey.com/test)

To make life easy, I zip up the files and upload the one file which is then extracted on the web server itself (takes about 12 minutes to upload vs. who knows how long for 21000 individual files). This is a Bluehost account for those wanting to guage speed etc. The zip file was ~82MB set to store (not bother trying to compress).

If you have any comments on the speed of access, etc, I'm curious. I'm using Firefox 3.0x to view things just fine. Does it work for you in your browser?

As well, I'd scaled up the original image from ~10000px to 40000px adjusted a few settings, and then scaled back down. Is the end result of definition/clarity acceptable? I'm trying for a watercolour-base with ink/chalk pastel for detail.

guyanonymous
03-28-2009, 06:25 PM
Of course, now there's an issue with the key. #@$@#$%$

Working now for me.

torstan
03-28-2009, 06:45 PM
Looks good to me.

Are we supposed to see all the text at all zooms?

guyanonymous
03-28-2009, 06:53 PM
Right now it's one image for the whole thing. Ideally, there would be different images for each level of zoom showing text appropriate for that scale....

For now though, just to be clear, there are 12 or so lines of text with a font size ranging from 1px to 100px. For me (and I hope others) 1px is unreadable. By 2.5px, clarity is there. 3px + are all just fine. But when zoomed out, you do see the tiny unreadable text. Sigh.

Hmm..I guess I could create a different version for each zoom level. I'd then have to merge the different tiles, as appropriate from each zoom. Only 21000 gif files for each level to sort. No problem :(

guyanonymous
03-28-2009, 07:56 PM
OK, by again doubling the memory allocated to the image cutting program, I was able to load a 30000px (width) bmp file.

Now I'm wondering how I can export a file (that's over 30000px width) from photoshop in bmp format.

guyanonymous
03-28-2009, 07:58 PM
Or better yet - can any of you suggest some image-editing software (vector preferred) than can work with such massive files?

Redrobes
03-28-2009, 08:24 PM
This has been an interesting thread. SeerBlue did something similar with our CWBP worlds only I checked that site and its down now. But that was doing the same sort of thing by using, I think, Global Mapper to do the conversion but I might be wrong there.

I checked my BlueMarble image which is 52Kx26K and that takes 700Mb or so of files. I have a test file for my app which is 150K square or so but its about 20Gb. The blue marble originals were 2x 26x26K in TIF too. I had to convert to RAW then into PNGs.

Seers thread
http://www.cartographersguild.com/showthread.php?t=2026

Redrobes
03-28-2009, 09:32 PM
I have been doing some tests here. I loaded up Blue Marble in my app and I can zoom around on that ok though it is just a little bit slower. Thats a 52x26K image. I can save that as a BMP at 40K wide from there and it took about a minute or two max to save it. Heres where it gets interesting tho.

I tried the image and fax viewer to look at the image and it thought for ages and then it failed and printed up couldn't load it. I tried my own picture viewer and that failed too after a while. Both of these are 64 bit. I tried IrfanView and Gimp they both failed immediately cos they were both 32 bit. There is a 64 bit Gimp out which I should try tho. Then I tried MSPaint. It chundered the disk for probably 20 minutes and put up a dialog that it had failed and yet it was showing some of the image. I don't know how much but enough to get to the image below. Putting up the information shows that it was a 40K image it tried to load. Note the file size on disk - Hey MS use a size_t not an int for the file size heh heh. Bug right there. But it did load some of it. The only thing I have which nearly did it. Basically any BMP over about 30K and your generally wasting your time.

guyanonymous
03-28-2009, 09:37 PM
Sounds like what I've been finding. BTW...of which blue marble image do you speak?

guyanonymous
03-28-2009, 09:38 PM
ah...figured out now :D

philipstephen
03-30-2009, 12:29 AM
i've been trying to load larger images and it does not even try to load them... smaller crappy ones, sure. but large ones (like 15000 pix wide) and it does not try...

sad.

guyanonymous
03-30-2009, 12:39 AM
In the .bat file (at least on the Windows version) you have to edit it...

There are two values for the amount of memory it needs. Here is how mine reads now:

start javaw -Xms8192M -Xmx16384M -jar gmapimagecutter.jar
exit


That let me load the 30000x wide test image I made.

I hope that works for you.

guyanonymous
03-30-2009, 12:43 AM
And where are our 64bit versions of all the map making software and terrain generators (other than Wilbur)? I still haven't gotten any of them to break past 9000 px. in export.

guyanonymous
03-30-2009, 02:03 AM
Well, I'm just uploading a 30000px wide version now.

In PS it was set to 300dpi.

The text blocks around the page were my tests for appropriate font sizes. I'm testing 1px to 10px in photoshop using the Papyrus font for anyone wondering.

I'll leave this up here for a month or two on my site.

guyanonymous
03-30-2009, 02:14 AM
And this setting (level 8 detail in the software) seems to provide ~1:1 correspondence with the 30000px image.

robb75067
03-30-2009, 01:18 PM
Thanks for this find.

guyanonymous
03-30-2009, 04:46 PM
I'm glad some others can use the info besides me.

I'm now thinking about interesting ways to share photos etc....

John Anderson
03-31-2009, 08:31 AM
This is great! Now, I'd really love to use this on my RPG campaign site (http://burningplay.wordpress.com/) where I'll be posting my maps but I can't find anywhere on the site to say whether it can be used as a plugin for sites like wordpress. Any ideas?
John

guyanonymous
03-31-2009, 11:41 AM
Not off hand. It is just an HTML file - so if you're able to insert that code anywhere...in a frame maybe?

robb75067
03-31-2009, 07:47 PM
I'm not having much luck with large files. I played around to see the limits and 5000 x 3991 72 dpi jpg on setting 12 (max) is fine but up one pix in any direction will cause the app to not even attempt to load the file. I can save the jpg on 8 and squeeze a few more pixel out of it but not enough to justify. I also played with the memory settings and found no difference in file size that can be loaded. I did try turning off anti virus (avast) and then tested files slightly over what I know can load without success. When I viewed the memory monitor larger files don't appear to be attempting to load.


guyanonymous: can you give me a little more info on how you loaded the larger files? I'd like to do 12000 x 8000 72 dpi setting 12 jpg. Did you ever have to sit at the "no image loaded" black screen and wait for a load or did you get a progress bar?



Thanks

guyanonymous
03-31-2009, 09:12 PM
I created the files (now up to 30000x23514) in Photoshop. This is the largest size it can save as a jpg/png/bmp. I'm saving as a bmp so that there's no computational overhead to compress/decompress the 1.3GB file.

Here is the content of the .bat file. I modified the amount of memory until it would work for me. I had it at 8192/16384 but found it paged EVERYTHING to my drive and went from taking about 12 minutes to process to taking hours (before I quit). The values now (8192/8192) seem to work and processing is fairly quick (IMHO).


start javaw -Xms8192M -Xmx8192M -jar gmapimagecutter.jar
exit


Beyond that, I run the batch file which loads the program (gmapimagecutter.jar) with the memory options set.

That lets me then load the big image file. I think that .bmp files also have a 2GB limit in size, which means I couldn't have a 30000x30000 file which I did try. I think that comes in around 2.7 GB.

I have it set at Max Zoom Level 8 in the image cutter program. This produces close to 1:1 representation. It actually zooms in a bit farther, but I can live with that.

I hope that works for you.

Oh - for the record, I use Vista 64 with 6GB of ram. I don't know if this program uses more than 4GB itself or not.

robb75067
03-31-2009, 09:50 PM
http://www.zoomify.com/ - basic is free

As long as you have a webserver this seems to be a great alternitive to Google Maps API. I've tested 12000 x 8000 jpgs and they work flawlessly. I'm assumming much larger files will work as well as the image on thier home page is much larger than the ones I tested.

robb75067
03-31-2009, 09:53 PM
I created the files (now up to 30000x23514) in Photoshop. This is the largest size it can save as a jpg/png/bmp. I'm saving as a bmp so that there's no computational overhead to compress/decompress the 1.3GB file.

Here is the content of the .bat file. I modified the amount of memory until it would work for me. I had it at 8192/16384 but found it paged EVERYTHING to my drive and went from taking about 12 minutes to process to taking hours (before I quit). The values now (8192/8192) seem to work and processing is fairly quick (IMHO).



Beyond that, I run the batch file which loads the program (gmapimagecutter.jar) with the memory options set.

That lets me then load the big image file. I think that .bmp files also have a 2GB limit in size, which means I couldn't have a 30000x30000 file which I did try. I think that comes in around 2.7 GB.

I have it set at Max Zoom Level 8 in the image cutter program. This produces close to 1:1 representation. It actually zooms in a bit farther, but I can live with that.

I hope that works for you.

Oh - for the record, I use Vista 64 with 6GB of ram. I don't know if this program uses more than 4GB itself or not.


Thanks guy. I'll try those settings.

guyanonymous
03-31-2009, 10:53 PM
I thought Zoomify had a resolution limit, especially in the free version? 3000x3000 or 6000x6000? Something like that.

robb75067
03-31-2009, 11:26 PM
I thought Zoomify had a resolution limit, especially in the free version? 3000x3000 or 6000x6000? Something like that.

I only tested the 12000 x 8000 but I haven't seen any limitations.

guyanonymous
04-01-2009, 04:06 PM
hmmm...all morning these maps have been working only on and off. I don't know if it's a google side thing, or a "Blue Host can't handle anything other than a straight html page." sorta thing.

guyanonymous
04-01-2009, 04:21 PM
ok, it seems, with testing, that I have no idea. Hitting F5 (the refresh key) until it works works.

guyanonymous
04-19-2009, 11:42 AM
An update: I've found that if I "create" a new key for each map I post, they work for me right away. Since that first day, I've not experienced any failure in loading the pages...knock on wood.

I also returned to my original experiment of using this as a means to share photos in a higher resolution. Here's my experiment with Family Photos quickly (ha) positioned on a white background. http://www.davidpiercey.com/family/1/Family01.html

I can envision using this to share photos with massive, fancy scrapbook-style layouts.

People can view, but not conveniently/easily save the images themselves. Their views can be in hi-res, if they want, but it's faster than sending them the pics themselves. And I can control the layout/viewing relationship to an extent.

RobA
04-20-2009, 04:20 PM
How did you arrange those? Manually?

-Rob A>

guyanonymous
04-20-2009, 05:01 PM
Yep - just random placement as I went through the family pics I had on my computer. If I was doing a real project, I'd attempt something a bit more artful :D

Almost all the shots were placed at 100% size/resolution as well, hence the range of sizes.

guyanonymous
04-20-2009, 05:52 PM
Out of curiosity - what do you folks think of viewing images in that way? If a friend/photographer/family member sent you a link with images to share in that format, would you enjoy it, get frustrated, etc?