Re: [Xastir] Re: Starting with a scanned USGS 7.5" paper map....

2008-01-19 Thread Tom Russo
On Sat, Jan 19, 2008 at 10:49:21PM +, we recorded a bogon-computron 
collision of the <[EMAIL PROTECTED]> flavor, containing:
> On Sat, 2008-01-19 at 11:27 -0700, Tom Russo wrote:
> > On Sat, Jan 19, 2008 at 12:12:22PM -0600, we recorded a bogon-computron 
> > collision of the <[EMAIL PROTECTED]> flavor, containing:
> > > I am collecting the USGS topographic maps for  my area and I am fortunate 
> > > in that all except one were on Libre Map.  The one that was missing, The 
> > > good folks at UW Madison Geography Library had the paper map and scanned 
> > > it 
> > > for me.  So now I have a 454MB scanned image in tif format.
> > 
> > Nice.
> > 
> > > Setting aside the fact that for one map, I would probably be better off 
> > > just buying the proper Geotiff map files  How do I go from 
> > > this 
> > > scanned image to a georeferenced digital file?  Can I get there from here?
> > 
> > Yes, but you need a tool that you probably don't have yet.  There are two
> > tools of choice, GRASS (http://grass.itc.it/) and QGIS 
> > (http://www.qgis.org/).  
> > GRASS can do more with your data, but QGIS has a simpler georeferencing 
> > tool.  
> > GRASS has a learning curve as steep that looks a lot like Everest, QGIS is
> > a bit of a PITA to install but is comparatively easy to use.
> 
> +1.  My opinion is a bit partisan, being a GRASS developer. ;-)

Heh.

> GDAL should be all you need to convert file formats and do basic
> warping.  It is very comprehensive, but lacks any GUI for GCP selection.

Agreed, as I've been using GRASS for years and am familiar with it enough
that I use it for everything.  But it is not the tool I would recommend to a 
person who wanted nothing more than to georectify a single image.  

GRASS *should* be all one needs if one is already familiar with it, but for
a one-shot effort such as this, something like QGIS could be easier.

The point is sorta moot here since Jim is in the process of uploading the image
to someplace where I can get at it, and I will be doing the georectifying in
GRASS.

> Learning GRASS is a fairly involved process.  It is generally geared
> toward research as opposed to ease of use.  I new wxPython GUI is
> actively been developed and should be mature by GRASS v7.

So far, I've found that all the attempts at putting a GUI on grass have gotten
in my way, but gis.m is getting pretty good.  I haven't touched wxPython yet,
because I still prefer to just use command line tools.

It's taken me a long time using GRASS casually to be able to use it for the
things I need to use on the very infrequent occasions when I need it.  But
it's definitely my tool of choice.

> One of these days, I really need to put together some tutorials geared
> towards Xastir.  I'm usually too busy on other projects. :(

I've often posted here about how to do this very operation, but at this point
I've concluded that GRASS is a great tool that I'll swear by, but not ever
again recommend for casual use to someone who just wants to get one thing done.

> [snip]
> 
> > Yes, it does.  Georeferencing scanned images is tricky and time consuming, 
> > so
> > it is expected that few will want to do it.  I've done it many times, and I
> > try to avoid doing it if possible.  But with the right tools and a little
> > care it can be done.
> 
> This largely depends on your image size (cell count), resolution and
> GCPs.  It can take anywhere from a few seconds to hours.

The time-consuming part is doing all the steps to get the thing set up.  For
example, if one were to choose the 16 lat/lon graticule marks in a USGS
DRG, one would have to convert each of the 16 points to UTM, because
the desired end product is a raster georeferenced in the coordinates used for
the projection --- using the lat/long values directly and rectifying into a
lat/lon location would give bad results (and is usually the first thing someone
tries to do).  So the coordinates have to be read off the image, converted,
and then one must painstakingly click on the exact points in the image where
the graticule lines cross, then enter the data.  It's not hard, nor is it
exactly rocket surgery, but it's time consuming and there is a lot of room
for error that will result in a poorly rectified image.  Naturally, one can
short-cut the process and choose fewer GCPs for this particular task.

-- 
Tom RussoKM5VY   SAR502   DM64ux  http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick
___
Xastir mailing list
Xastir@xastir.org
http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir


Re: [Xastir] Re: Starting with a scanned USGS 7.5" paper map....

2008-01-19 Thread Brad Douglas
On Sat, 2008-01-19 at 11:27 -0700, Tom Russo wrote:
> On Sat, Jan 19, 2008 at 12:12:22PM -0600, we recorded a bogon-computron 
> collision of the <[EMAIL PROTECTED]> flavor, containing:
> > I am collecting the USGS topographic maps for  my area and I am fortunate 
> > in that all except one were on Libre Map.  The one that was missing, The 
> > good folks at UW Madison Geography Library had the paper map and scanned it 
> > for me.  So now I have a 454MB scanned image in tif format.
> 
> Nice.
> 
> > Setting aside the fact that for one map, I would probably be better off 
> > just buying the proper Geotiff map files  How do I go from this 
> > scanned image to a georeferenced digital file?  Can I get there from here?
> 
> Yes, but you need a tool that you probably don't have yet.  There are two
> tools of choice, GRASS (http://grass.itc.it/) and QGIS 
> (http://www.qgis.org/).  
> GRASS can do more with your data, but QGIS has a simpler georeferencing tool. 
>  
> GRASS has a learning curve as steep that looks a lot like Everest, QGIS is
> a bit of a PITA to install but is comparatively easy to use.

+1.  My opinion is a bit partisan, being a GRASS developer. ;-)

GDAL should be all you need to convert file formats and do basic
warping.  It is very comprehensive, but lacks any GUI for GCP selection.

> The trick is to carefully select points of known coordinates (in the 
> coordinate system of the map, which in this case are probably UTM) and give 
> the georeferencer the locations of those points in the image (the USGS uses 
> the 16 lat/lon graticule points).  It then computes the affine transformation 
> from image coordinates to geographic coordinates and puts in the 
> necessary TIFF tags.

GRASS can help here (i.rectify) to select coordinate pairs for warping.

> It is a fairly involved process.  I might be willing to do it for you --- I've
> done it for a few other people on the list.  It just so happens that this
> weekend I've chosen to set aside a lot of time to do GIS work, so if you 
> put your data somewhere where I could grab it today, I'd take a look.  

Learning GRASS is a fairly involved process.  It is generally geared
toward research as opposed to ease of use.  I new wxPython GUI is
actively been developed and should be mature by GRASS v7.

One of these days, I really need to put together some tutorials geared
towards Xastir.  I'm usually too busy on other projects. :(

[snip]

> Yes, it does.  Georeferencing scanned images is tricky and time consuming, so
> it is expected that few will want to do it.  I've done it many times, and I
> try to avoid doing it if possible.  But with the right tools and a little
> care it can be done.

This largely depends on your image size (cell count), resolution and
GCPs.  It can take anywhere from a few seconds to hours.


-- 
73, de Brad KB8UYR/6 

___
Xastir mailing list
Xastir@xastir.org
http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir


[Xastir] Re: Starting with a scanned USGS 7.5" paper map....

2008-01-19 Thread Tom Russo
On Sat, Jan 19, 2008 at 12:12:22PM -0600, we recorded a bogon-computron 
collision of the <[EMAIL PROTECTED]> flavor, containing:
> I am collecting the USGS topographic maps for  my area and I am fortunate 
> in that all except one were on Libre Map.  The one that was missing, The 
> good folks at UW Madison Geography Library had the paper map and scanned it 
> for me.  So now I have a 454MB scanned image in tif format.

Nice.

> Setting aside the fact that for one map, I would probably be better off 
> just buying the proper Geotiff map files  How do I go from this 
> scanned image to a georeferenced digital file?  Can I get there from here?

Yes, but you need a tool that you probably don't have yet.  There are two
tools of choice, GRASS (http://grass.itc.it/) and QGIS (http://www.qgis.org/).  
GRASS can do more with your data, but QGIS has a simpler georeferencing tool.  
GRASS has a learning curve as steep that looks a lot like Everest, QGIS is
a bit of a PITA to install but is comparatively easy to use.

The trick is to carefully select points of known coordinates (in the 
coordinate system of the map, which in this case are probably UTM) and give 
the georeferencer the locations of those points in the image (the USGS uses 
the 16 lat/lon graticule points).  It then computes the affine transformation 
from image coordinates to geographic coordinates and puts in the 
necessary TIFF tags.

It is a fairly involved process.  I might be willing to do it for you --- I've
done it for a few other people on the list.  It just so happens that this
weekend I've chosen to set aside a lot of time to do GIS work, so if you 
put your data somewhere where I could grab it today, I'd take a look.  

> Looking at the other fdg files in the set, it seems that they indicate that 
> the USGS 7.5" maps are reduced to 250dpi.  When I do that, my files are ~3X 
> the other geotif files in the set (10MB vs 3.7 MB). 

In addition, you might not be using "PACKBITS" compression, *AND* the USGS
does a lot of work to standardize their color scheme.  USGS maps have only 
twelve colors, and because of that they can be stored in a single 8-bit
band.  Your maps are, dollars to donuts, 3-band 24 bit color.  Between the 
two I could easily imagine a 3X size difference.

To figure that out, take a look at the output of "gdalinfo" on your tiff file.
If it lists a color map at the end, you've got an 8 bit image, if it just 
gives you three lines listing what each band represents, you have a 24 bit
color image.

To duplicate a USGS DRG, you'd have to map all the complex colors in the file
to the 12 standard colors USGS uses.  Doing *THAT* is serious work, and might 
not be worth your trouble.  If your goal is just to get a map that looks nice
in xastir, you could just use the GDAL tool "rgb2pct.py" which takes a 24
bit image and constructs an 8-bit pseudocolor image by dithering down to a 
smaller range of colors.  It can be good enough as long as you don't try to
use the feature of xastir that lets you pick and choose which colors of a 
USGS map to display (i.e. with that feature you could display only the contour
lines and let everything else be transparent, but it requires that the image
have the 12 standard colors).

> Using GeoTiffExaminer  
> (http://www.mentorsoftwareinc.com/FREEBIE/FREE0699.HTM ), it would seem 
> that I could convert a scanned tif image into a Geotiff file if I knew what 
> georeferencing info to give it.

Yes, you definitely could, but as I said, it requires some tools you'd have to
install and get familiar with.

> In trying to understand README.MAPS, it seems that those instructions 
> assume that you are starting with a GeoTiff map of some extraction.

Yes, it does.  Georeferencing scanned images is tricky and time consuming, so
it is expected that few will want to do it.  I've done it many times, and I
try to avoid doing it if possible.  But with the right tools and a little
care it can be done.

-- 
Tom RussoKM5VY   SAR502   DM64ux  http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick
___
Xastir mailing list
Xastir@xastir.org
http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir