[GRASS-user] Import/conversion problem

Stuart Edwards sedwards2 at cinci.rr.com
Fri Feb 11 15:14:44 EST 2011


I'm not familiar with the Kyngesburye plugin and haven't used gdalwarp, but here:

>>> I want to import it into a UTM zone 17 project.  So I did the following:
>>> gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84' input.sid output_utm.sid

it looks like you are just trying to create a new .sid file in zone 17 (output_utm.sid).  From the meta file at the MI source, I think the file is already projected in utm - probably in zone 17, and with units of 'meters'.  So what you maybe intended was to just create a .tiffg from the .sid so that it can be imported into GRASS.

In mrsiddecode (the app that does all the work inside the plugin - I assume) I would just issue the command

./mrsiddecode -i Hancock.sid -o Hancock_south.tif -of tifg -ulxy 0 0 -lrxy 71145 29160  

where

-i - input
-o - output
-of - output file type
ulxy - upper left x,y
lrxy - lower right x,y

and you get a nice geotiff that r.in.gdal will recognize - already in utm zone 17 most likely.  Actually, in my case, the OH mrsids are projected in state plane coordinates but you get the picture.

To get the mrsiddecode app you must register at 

http://developer.lizardtech.com/ 

so you can access to the Mac version of the decoder and mrsidinfo download page.  And be slightly comfortable on the command line.

Stu



On Feb 11, 2011, at 2:08 PM, Adam Dershowitz, Ph.D., P.E. wrote:

> I am also working on OS X.  But, I am using the MrSID plugin, from William Kyngesburye.  So it seems that both gdalwarp and r.in.gdal are willing to import it.  But, maybe I will try to search around for the apps that you are referring to, to see if they might do a better job on the conversion.  
> Are you suggesting that the MrSID plugin that I have is working, but is loosing reference data along the way?
> 
> --Adam
> 
> 
> 
> On Feb 11, 2011, at 10:47 AM, Stuart Edwards wrote:
> 
>> MrSID files are a bit tricky.  This is a proprietary format owned by LizardTech (see http://www.gdal.org/frmt_mrsid.html).  That being said, they freely provide decode tools at their website (http://www.lizardtech.com/).  Working on OS X, I use their Raster_DSDK in a little command line routine to convert the file to a geotiff (tifg) and then import it into GRASS with r.in.gdal.  Note that the MrSID format is very efficient and boils a quad down to about 1.5 Gb.  This will become 3 or 4 times greater as a tif so make sure you have plenty of room to store it and process it.  I use an old version of Expressview (a LizardTech viewer that used to be available for OS X) to look at the image and determine the coordinates of the bit that I really want in order to minimize the resulting file sizes.
>> 
>> AFAIK there are no open source apps that deal with MrSID directly (for those that do, you have to install your own version of the decoder first)
>> 
>> Stu
>> 
>> 
>> On Feb 11, 2011, at 12:23 PM, Adam Dershowitz, Ph.D., P.E. wrote:
>> 
>>> I am trying to import some data in GRASS and have run into a problem.  I hope someone can give me a little insight to help out.
>>> I downloaded some aerial imagery from here:
>>> http://www.michigan.gov/dnr/0,1607,7-153-10371_14546-30211--,00.html
>>> 
>>> I want to import it into a UTM zone 17 project.  So I did the following:
>>> gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84' input.sid output_utm.sid
>>> 
>>> gdapwarp responds with an error, but then continues with the conversion:
>>> ERROR 6: Failed to initialize PROJ.4 with `+proj=omerc +lat_0=0 +lonc=0 +alpha=0 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs '.
>>> lat_0 = 0 or 90 or alpha = 90
>>> 0...10...20...30...40...50...60...70...80...90...100 - done.
>>> 
>>> If I then try to import the image, into my project, it does work, but places it WAY off from where it should be (millions of meters!).  I guess I should not be surprised, since the error says that it is trying to use a lat/long of 0.  But I don't understand why it is not working correctly.  
>>> 
>>> So, clearly something is wrong with how I am doing the conversion.  Am I missing a flag or something?  It looks to me like gdalinfo is doing a correct read, but somehow gdalwarp is missing something on the input.
>>> Any help would be greatly appreciated.  
>>> 
>>> If I do gdalinfo on the input file, here is what I get:
>>> 
>>> Driver: MrSID/Multi-resolution Seamless Image Database (MrSID)
>>> Files: oakgrove_sw.sid
>>>     oakgrove_sw.sdw
>>>     oakgrove_sw.sid.aux.xml
>>> Size is 6415, 8061
>>> Coordinate System is:
>>> PROJCS["IMAGINE GeoTIFF Support
>>> Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
>>> @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
>>> Projection = Oblique Mercator (Hotine)|IMAGINE",
>>>  GEOGCS["NAD83",
>>>      DATUM["North_American_Datum_1983",
>>>          SPHEROID["GRS 1980",6378137,298.2572221010002,
>>>              AUTHORITY["EPSG","7019"]],
>>>          AUTHORITY["EPSG","6269"]],
>>>      PRIMEM["Greenwich",0],
>>>      UNIT["degree",0.0174532925199433],
>>>      AUTHORITY["EPSG","4269"]],
>>>  PROJECTION["Hotine_Oblique_Mercator"],
>>>  PARAMETER["latitude_of_center",0],
>>>  PARAMETER["longitude_of_center",0],
>>>  PARAMETER["azimuth",0],
>>>  PARAMETER["rectified_grid_angle",90],
>>>  PARAMETER["scale_factor",1],
>>>  PARAMETER["false_easting",0],
>>>  PARAMETER["false_northing",0],
>>>  UNIT["metre",1,
>>>      AUTHORITY["EPSG","9001"]]]
>>> Origin = (663144.500000000000000,240035.500000000000000)
>>> Pixel Size = (1.000000000000000,-1.000000000000000)
>>> Metadata:
>>> IMAGE__INPUT_NAME=K:\blk18\oakgrove_sw.tif
>>> IMAGE__INPUT_FILE_SIZE=155199578.000000
>>> GEOTIFF_NUM__1024__GTModelTypeGeoKey=1
>>> GEOTIFF_CHAR__GTModelTypeGeoKey=ModelTypeProjected
>>> GEOTIFF_NUM__1025__GTRasterTypeGeoKey=1
>>> GEOTIFF_CHAR__GTRasterTypeGeoKey=RasterPixelIsArea
>>> GEOTIFF_NUM__1026__GTCitationGeoKey=IMAGINE GeoTIFF Support
>>> Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
>>> @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
>>> Projection = Oblique Mercator (Hotine)|IMAGINE GeoTIFF Support
>>> Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
>>> @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
>>> Projection Name = Oblique Mercator (Hotine)
>>> Units = meters
>>> GeoTIFF Units = meters|
>>> GEOTIFF_NUM__2048__GeographicTypeGeoKey=4269
>>> GEOTIFF_CHAR__GeographicTypeGeoKey=GCS_NAD83
>>> GEOTIFF_NUM__2060__GeogAzimuthUnitsGeoKey=9102
>>> GEOTIFF_CHAR__GeogAzimuthUnitsGeoKey=Angular_Degree
>>> GEOTIFF_NUM__3072__ProjectedCSTypeGeoKey=32767
>>> GEOTIFF_CHAR__ProjectedCSTypeGeoKey=User-Defined
>>> GEOTIFF_NUM__3073__PCSCitationGeoKey=IMAGINE GeoTIFF Support
>>> Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
>>> @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
>>> Projection = Oblique Mercator (Hotine)|IMAGINE GeoTIFF Support
>>> Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
>>> @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
>>> Projection Name = Oblique Mercator (Hotine)
>>> Units = meters
>>> GeoTIFF Units = meters|
>>> GEOTIFF_NUM__3074__ProjectionGeoKey=32767
>>> GEOTIFF_CHAR__ProjectionGeoKey=User-Defined
>>> GEOTIFF_NUM__3075__ProjCoordTransGeoKey=3
>>> GEOTIFF_CHAR__ProjCoordTransGeoKey=CT_ObliqueMercator
>>> GEOTIFF_NUM__3076__ProjLinearUnitsGeoKey=9001
>>> GEOTIFF_CHAR__ProjLinearUnitsGeoKey=Linear_Meter
>>> GEOTIFF_NUM__3088__ProjCenterLongGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.000000
>>> GEOTIFF_NUM__3089__ProjCenterLatGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.000000
>>> GEOTIFF_NUM__3090__ProjCenterEastingGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.000000
>>> GEOTIFF_NUM__3091__ProjCenterNorthingGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.000000
>>> GEOTIFF_NUM__3093__ProjScaleAtCenterGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.000000
>>> GEOTIFF_NUM__3094__ProjAzimuthAngleGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.000000
>>> IMAGE__Z_RESOLUTION=0.000000
>>> GEO__ModelTypeGeoKey=1
>>> GEO__ProjectedCSTypeGeoKey=32767
>>> GEO__PCSCitationGeoKey=IMAGINE GeoTIFF Support
>>> Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
>>> @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
>>> Projection = Oblique Mercator (Hotine)|IMAGINE GeoTIFF Support
>>> Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
>>> @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
>>> Projection Name = Oblique Mercator (Hotine)
>>> Units = meters
>>> GeoTIFF Units = meters|
>>> IMAGE__Z_ORIGIN=0.000000
>>> IMAGE__COMPRESSION_VERSION=1,6,1
>>> IMAGE__TARGET_COMPRESSION_RATIO=20.000000
>>> IMAGE__COMPRESSION_NLEV=4
>>> IMAGE__COMPRESSION_WEIGHT=4.000000
>>> IMAGE__COMPRESSION_GAMMA=2.000000
>>> IMAGE__COMPRESSION_BLOCK_SIZE=512
>>> IMAGE__CREATION_DATE=Wed Mar 10 17:11:37 2004
>>> 
>>> VERSION=MG2
>>> IMAGE__BITS_PER_SAMPLE=8
>>> IMAGE__WIDTH=6415
>>> IMAGE__HEIGHT=8061
>>> IMAGE__COLOR_SCHEME=0
>>> IMAGE__DATA_TYPE=0
>>> IMAGE__XY_ORIGIN=663145.000000,240035.000000
>>> IMAGE__X_RESOLUTION=1.000000
>>> IMAGE__Y_RESOLUTION=1.000000
>>> Image Structure Metadata:
>>> INTERLEAVE=PIXEL
>>> Corner Coordinates:
>>> Upper Left  (  663144.500,  240035.500) 
>>> Lower Left  (  663144.500,  231974.500) 
>>> Upper Right (  669559.500,  240035.500) 
>>> Lower Right (  669559.500,  231974.500) 
>>> Center      (  666352.000,  236005.000) 
>>> Band 1 Block=1024x128 Type=Byte, ColorInterp=Red
>>> Minimum=0.000, Maximum=255.000, Mean=97.677, StdDev=49.163
>>> Overviews: 3208x4031, 1604x2016, 802x1008, 401x504
>>> Band 2 Block=1024x128 Type=Byte, ColorInterp=Green
>>> Minimum=0.000, Maximum=255.000, Mean=97.555, StdDev=49.371
>>> Overviews: 3208x4031, 1604x2016, 802x1008, 401x504
>>> Band 3 Block=1024x128 Type=Byte, ColorInterp=Blue
>>> Minimum=0.000, Maximum=255.000, Mean=97.402, StdDev=49.024
>>> Overviews: 3208x4031, 1604x2016, 802x1008, 401x504
>>> 
>>> 
>>> 
>>> --Adam
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> grass-user mailing list
>>> grass-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>> 
> 
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20110211/4b0df496/attachment-0001.html


More information about the grass-user mailing list