TopoGrafix GPS Software Forums: Making your own map tiles for use in ExpertGPS - TopoGrafix GPS Software Forums

Jump to content

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

Making your own map tiles for use in ExpertGPS Tiler for ExpertGPS - a free utility

#41 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 27 February 2009 - 08:08 PM

View PostDonK, on Feb 27 2009, 04:44 PM, said:

Tim,

I did include the jgw. But there are a couple of things I'm not clear on. Here is a command line that has worked well when merging .tif files that started out as MrSid:

gdalwarp -s_srs EPSG:26986 -t_srs EPSG:26986 -of GTiff -co "TFW=YES" first-tile.tif second-tile.tif merged-tile.tif

Now, to merge jpg files instead of .tif, wouldn't the first two switches, -s_srs EPSG:26986 -t_srs EPSG:26986, remain the same since the coordinate system which remains the same regardless of file type? If that is true, then what I'm still unclear on is how to change the -of and -co switches so they work with jpeg files. This, I think, is where the gdal error message is being generated.

For jpeg files:

gdalwarp -s_srs EPSG:26986 -t_srs EPSG:26986 -of ???? -co ???? first-tile.jpg second-tile.jpg merged-tile.jpg

We're keeping you busy today, Tim. You're working two questioners at once! :)

Don


You're correct about the EPSG numbers remaining the same if the files are just jpeg representations of the original georeferenced files.

For merging two jpeg files to a Geotiff (can't write a jpeg as output from Gdalwarp) the command would be:

gdalwarp -s_srs EPSG:26986 -t_srs EPSG:26986 -of GTIFF -co TFW=YES first-tile.jpg second-tile.jpg merged-tile.tif

For that command to work you also have to have .jgw files for both first-tile.jpg and second-tile.jpg in the same folder with the image files.


Then to change the output file to a jpeg you would enter the command:

gdal_translate -of JPEG -co WORLDFILE=YES merged-tile.tif merged-tile.jpg

The worldfile that is produced will probably have a .wld extension. You can change this to .jgw manually for compatibility with ExpertGPS.


Tim
0

#42 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 28 February 2009 - 01:13 PM

View PostTim Osborn, on Feb 27 2009, 07:08 PM, said:

For merging two jpeg files to a Geotiff (can't write a jpeg as output from Gdalwarp) the command would be:
gdalwarp -s_srs EPSG:26986 -t_srs EPSG:26986 -of GTIFF -co TFW=YES first-tile.jpg second-tile.jpg merged-tile.tif

Then to change the output file to a jpeg you would enter the command:
gdal_translate -of JPEG -co WORLDFILE=YES merged-tile.tif merged-tile.jpg

Tim

I did a slight variation on your formula above. First, I saved my original MrSID image files as .tifs. Then I used gdalwarp to merge the separate .tif files in to one large .tif file. Then I used gadal_translate to convert that file into a much smaller jpeg file. This jpg file, which was 16k x 16k pixels and 60 meg/Bytes opened okay in EGPS.

As an alternative, I sometimes us the open source program MapWindow GIS. It has two advantages 1.) It can open MrSID files directly and 2.) It can load multiple image tiles without the need to merge them first into a single file. That said, it can't do a number of other things that EGPS does well, so for me, it's not a replacement for EGPS.

Thanks for your tips Tim.

Don
0

#43 User is offline   Bill Victor 

  • Member
  • PipPip
  • Group: Members
  • Posts: 5
  • Joined: 13-June 06

Posted 02 March 2009 - 02:35 PM

View PostTim Osborn, on Feb 27 2009, 05:21 PM, said:

Bill:

In ExpertGPS go to Edit:Preferences. Then click on the Map Folder tab. There it will show you where your ExpertGPS Map Folder is located. For example, if it is C:\Mymaps, then the full path to where you want to save those two maps tiles would be: C:\Mymaps\TopoGrafix Image Files\Type2\Zone16\Scale12


Tim


Tim,
Got it. What can I do for you to return the favor?


Bill
0

#44 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 02 March 2009 - 03:08 PM

View PostBill Victor, on Mar 2 2009, 12:35 PM, said:

Tim,
Got it. What can I do for you to return the favor?


Bill



Nothing. Just glad I could help.

Tim
0

#45 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 24 July 2009 - 11:07 AM

Tim,

I have been trying out Tiler 2 and have been having a problem.

I've attached a couple of screenshots from EGPS to illustrate what's happening.

Screenshot 1 shows the original MassGIS .tif file of 4km x 4km ( 1573 x 1573 Pixels) tile imported complete and viewed as a "Scanned Map". This is the way I've been doing it and everything looks fine.

Screenshot 2 shows the same .tif file processed through Tiler 2 and viewed as a "Topo Map". You can see that the whole tile is not displayed. The red squares are a shape file of the MassGIS topo tile grid. Tiler produces the image file folders and they contain a series of 200 x 200 pixel tiles.

I also included a Waypoint in the middle marked "Fitchburg". It shows up exactly where it should, at the junction of those two roads.

1:Posted Image 2: Posted Image



Any ideas?

Thanks,

Don
0

#46 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 24 July 2009 - 04:38 PM

You probably created the tiles with the "Crop In" radio button selected. Instead retry the tile making process with "Pad Out" selected. It's likely that your original image is not entirely coindicent with the Terraserver grid. So, potential tiles around the outside of your original image don't contain enough information to fill out full Terraserver-type tiles. With "Crop In" selected these "partial tiles" don't get created. With "Pad Out" extra pixels are added to the outside of your original image so that it is coincident with the Terraserver grid and you don't loose any of your original image.

Hope that makes sense.

Tim
0

#47 User is offline   Dan Foster 

  • Author of ExpertGPS and GeoBuddy
  • PipPipPip
  • Group: TopoGrafix
  • Posts: 2,155
  • Joined: 15-April 06
  • Location:Stow, MA, USA
  • Interests:Writing GPS Software!
  • geocaching.com username:topografix

Posted 24 July 2009 - 05:31 PM

Don, MassGIS imagery is projected in Mass State Plane Coordinates, which means they are rotated relative to the UTM projection that Terraserver tiles use.
0

#48 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 24 July 2009 - 11:31 PM

Here is what the tiles look like with "Pad Out" selected....you get the whole image you started with, plus black areas padded-out around the outside where the original image had some, but not all, of the pixels comprising those "edge" Terraserver tiles. If your area of interest is entirely within this image then the black areas won't be a problem, particularly if you save the tiles to a separate map folder for that project. But if your area of interest is larger, it's better to create your tiles in one session from a map covering the larger area to minimize these "edge problems."

Posted Image
0

#49 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 25 July 2009 - 12:11 PM

View PostTim Osborn, on Jul 24 2009, 11:31 PM, said:

But if your area of interest is larger, it's better to create your tiles in one session from a map covering the larger area to minimize these "edge problems."

Tim,

I merged eight MassGIS topo tiles into one large one and then processed them with Tiler 2. This time the results look good.

The original MassGIS tiles are 2 meter/pixel resolution. When processed with Tiler 2 at 4 meter/pixel resolution, it appears that I loose about half the resolution. It this true? Is there anyway to preserve the original resolution? Tiler won't let me use 1 meter/pixel resolution.

Thanks,

Don
0

#50 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 25 July 2009 - 12:52 PM

Tiler won't let you use 1 meter resolution for topo maps because the highest resolution tiles that ExpertGPS uses for topo maps are 4 meters per pixel. But, you can do the following if you wish: when you create the tiles, tell Tiler you are producing Aerial or Urban Photo tiles. That way you can produce 1 meter resolution tiles from the topo map image. Then when you access them through ExpertGPS, you will access the higher resolution topo tiles through the Aerial or Urban Photo map display.
0

#51 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 27 July 2009 - 11:44 AM

Tim,

I tried your suggestion and it does maintain the original, higher resolution of the MassGIS topos when viewing them in EGPS.

When printing, it appears the higher resolution is not maintained at small scales. For example, when the print scale is set to 1:30,000, EGPS uses the lower, 8 meters/pixel version of the map. When printing the same topo imported as a "Scanned Map", the original higher resolution is maintained at smaller print scales such as 1:30,000.

Is this correct? Any way to keep the original, higher resolution when printing these topos?

Thanks,

Don
0

#52 User is offline   Dan Foster 

  • Author of ExpertGPS and GeoBuddy
  • PipPipPip
  • Group: TopoGrafix
  • Posts: 2,155
  • Joined: 15-April 06
  • Location:Stow, MA, USA
  • Interests:Writing GPS Software!
  • geocaching.com username:topografix

Posted 27 July 2009 - 01:14 PM

Don, zoom in to the high-res topos before you click Show Print Map Window on the Map menu. That should lock in the map resolution.
0

#53 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 02 August 2009 - 12:50 PM

View PostTim Osborn, on Jul 24 2009, 11:31 PM, said:

If your area of interest is entirely within this image then the black areas won't be a problem, particularly if you save the tiles to a separate map folder for that project. But if your area of interest is larger, it's better to create your tiles in one session from a map covering the larger area to minimize these "edge problems."


Just so that I understand you correctly. To avoid the black areas between multiple MassGIS 4km x 4km topo tiles, I should first use a program like the gdalwarp utility that comes with FWTools to first merge them into a larger tile, then use Tiler.

My hope was to avoid the gdalwarp step and just use Tiler to produce larger versions of the MassGIS topo scans. It doesn't appear this is feasible to produce maps without any black borders between the original 4km x 4km tiles.

Thanks,

Don
0

#54 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 02 August 2009 - 03:07 PM

Don:

You understand correctly.

If the 4kmx4km MassGIS images came projected in UTM NAD83, at the correct resolution, and located exactly coincident with the Terraserver grid, then you could use Tiler to bust up the 4kmx4km images into tiles and everything would fall wonderfully into place. There would by definition be no excess or deficiency of image information around the border of the image, relative to the Terraserver grid, so there would be no black borders in the produced tiles and adjoining 4kmx4km MassGIS images could be busted-up into tiles one-by-one to produce a complete tiling for ExpertGPS.

Unfortunately, the MassGIS images come projected as Mass State Plane. So, the original 4kmx4km images have to be reprojected which at a minimum causes a rotation of the original image resulting in black triangles of pixels along each side of the image. That in itself kills the ability to produce a complete tiling from individual 4kmx4km images even if they somehow fell exactly on the Terraserver grid. So, the only thing to do is to merge as many 4kmx4km images as you need to more than cover your area of interest using GDALWARP and then create your tiles from the merged image using Tiler.
0

#55 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 02 August 2009 - 03:26 PM

View PostTim Osborn, on Aug 2 2009, 03:07 PM, said:

You understand correctly.

Tim,

Thanks for the quick reply and thanks from me and I'm sure many others for your work in enhancing a great application, EGPS.

Now that I have a better understanding of how Tiler works, I can consider which approach I want to use. Using GDALWARP only, to produce larger maps, or the GDALWARP plus Tiler approach both have their advantages and disadvantages.

BTW, do you or anyone else happen to know whether high resolution, 2 meter/pixel versions of the USGS 1:25k topos such as MassGIS makes available for free download, are also available for other parts of the country? I know such maps are available commercially, but having the topos and orthophotos available for free is a nice return for our tax dollars.

Don
0

#56 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 02 August 2009 - 08:47 PM

The free USGS DRG's at libremap.org have resolutions of 2.54 meters per pixel for the entire US, although I've noticed that a number of DRG's seem to be missing for Mass. In Mass, a lot of the newer quads have been 15 minutes wide by 7.5 minutes tall metric 1:25000 scale maps that combined two former 7.5 minute by 7.5 minute quads.

Also for many States other than Mass you can find GIS websites that have freely available topo maps and aerial photos for download. In Arkansas, for example, there is sal.uamont.edu that has unclipped, clipped, and hill shaded topos for the whole State.

There is also the USGS seamless map server at seamless.usgs.gov where you can download 1:24000 topos for user-defined areas that may contain multiple quads and parts of quads at 2.44 meters per pixel.

There are also the freely available GeoPDF topo maps freely available from the USGS store for the whole US. Using the appropriate software they can be converted into tif or jpeg files to make tiles, etc, but they suffer from compression artifacts that occured in the creation of the PDF's.
0

#57 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 03 August 2009 - 11:54 AM

Tim,

Thanks for the information. I've taken a look at several of them.

I was interested in the relative resolution quality between them, so I opened two of them in EGPS. Both are shown at the 1:2,500 zoom level. The top is from the Arkansas site you mentioned and the bottom image is from MassGIS.

How would you compare the resolution quality?

Don

Posted Image


Posted Image
0

#58 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 03 August 2009 - 02:51 PM

The one from the MassGIS website obviously looks a lot better. While both have approximately the same resolution, no doubt they were processed differently. One big thing that makes them look different is the number of colors in their indexed color tables. The MassGIS maps have 256 different colors whereas maps derived from USGS DRG's have only 13 different colors in the indexed color table. That gives the MassGIS maps a much smoother look...the same effect as anti-aliasing.
0

#59 User is offline   DonK 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 68
  • Joined: 30-October 08
  • Location:Arlington, Massachusetts

Posted 03 August 2009 - 05:32 PM

Tim,

Your point is interesting. The additional colors make quite a difference.

At the USGS Store they discuss the "Digital Map - Beta", "the next generation of USGS topographic maps." Among other things, they a supposed to be much higher resolution. They are in the GeoPDF® format. Have you looked at these maps? I can't seem to find any to download.

Don
0

#60 User is offline   Tim Osborn 

  • Advanced Member
  • PipPipPip
  • Group: GPS Expert
  • Posts: 540
  • Joined: 17-April 06
  • Gender:Male
  • Location:NW Arkansas

Posted 03 August 2009 - 06:06 PM

To download GeoPDF topos from USGS, go to the USGS Store (http://store.usgs.gov) and click on the right side where it says "Download Topo Maps Free." Then read the instructions on the right side of the new page that is shown. If I recall correctly, USGS has been saying for quite a while that their newer DRG's will be scanned at 500ppi, but I haven't seen any at that resolution including the GeoPDFs I've looked at.

I don't really care much for the GeoPDF maps. They use a fairly heavy level of compression and you can see the "ringing" in the image, plus there is not much software currently than can use GeoPDF's other than Acrobat. It's also another case of a Federal Government Agency distributing public information in a proprietary format (like the whole MrSID experience). If you want to create your own GeoPDF's or do anything other than just look at them in Acrobat, you have to license the technology from TerraGo.

In terms of apples-to-apples comparisons, here is a 100 percent crop (1 pixel in map equals one pixel on screen) of a MassGIS 4kmx4km map. This was scanned by MassGIS at 300ppi with 256 colors.
Posted Image


Next is a 100 percent crop of the same area in a USGS DRG downloaded from the Libre Map website. This was scanned by USGS at 250ppi with 13 colors. The colors are less pleasing and the text and lines are a bit more jagged looking compared with the MassGIS image. This is a combination of the slightly lower resolution and the limited color set.
Posted Image


Finally, here is a 100 percent crop of the same area from a USGS GeoPDF. You can see the "ringing" artifacts from the compression. Of course, in terms of getting done what one needs to get done, any of these maps is more than sufficient and we in the U.S. are far more fortunate than citizens of most countries in having easy access to free maps and aerial photos, although in most parts of the country USGS hasn't updated their topo maps in quite a long time.
Posted Image
0

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users