[GRASSLIST:5706] v.proj problems - state plane to UTM

Philipp Molzer phil at molzer.net
Sun Mar 2 12:13:23 EST 2003


Hi,
I'm using grass5.0.0 on Linux RedHat8 (intel).
I have a DEM upon which I'd like to overlay some census data (vectors). 
 The DEM is in UTM format while the vectors are in state plane format. 
 Both locations are NAD83.  Both cover the area of Essex County, New 
Jersey, USA. When I use v.proj to bring the vectors from my state plane 
location to my UTM location, the resulting vector data has coordinates 
that seem to be incompatible with the DEM coordinates.  The east and 
west bounds of the imported vector layer appear to be way off.

Also, I can't figure out how to change locations  except by exiting and 
restarting grass.

Here are the details:
Source of DEM
DEM was imported into a location with these specifications

    name:    UTM
    datum:   nad83
    dx:      0.000000
    dy:      0.000000
    dz:      0.000000
    proj:    utm
    ellps:   grs80
    a:       6378137.0000000000
    es:      0.0066943800
    f:       298.2572221010
    zone:    18
    -----------------------------------------------------------
    PROJ_UNITS file:
    unit:    meter
    units:   meters
    meters:  1.0

This is the code I used to do the import.
#the DEM is a set of patched together DEMs which I got from the New 
Jersey geol survey, covering Essex county
#the DEMs were in SDTS format
#this script includes extracting the files and importing them, then 
patching all together

    cd /DATA/GIS/NJ/ESSEX/DEM
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/lib
    LIST=`ls -1 *.GZ`
    L1=`echo $LIST |sed -e "s/\.DEM\.SDTS\.TAR\.GZ//g"`
    for FILE in $L1; do
      mkdir $FILE
      mv ${FILE}* $FILE
      cd $FILE
      tar zxvf ${FILE}.DEM.SDTS.TAR.GZ
      FILE=`ls *CATD*`
      F1=`echo $FILE |awk '{print substr($0,0,4)}'`
      OUT=`echo $DIR |sed -e "s/\///"`
      r.in.gdal -e input=$FILE output=$OUT
      r.support -r map=$OUT
      cd ..
    done
    r.patch
    input=1705847,1705869,1706050,1706056,1706084,1706086,1706096,1706105
    output=essexdem


r.info map=essexdem

        +----------------------------------------------------------------------------+
         | Layer:    essexdem                       Date: Sun Feb 23
        14:47:27 2003    |
         | Mapset:   essex_utm                      Login of Creator:
        pmolzer         |
         | Location:
        NJ_utm                                                           |
         | DataBase:
        /home/pmolzer/grassdata                                          |
         | Title:     ( essexdem
        )                                                    |
         |----------------------------------------------------------------------------|
         |                                                                           
        |
         |   Type of Map:  raster              Number of Categories:
        80               |
         |   Data Type:   
        FCELL                                                      |
         |   Rows:        
        25848                                                      |
         |   Columns:     
        22425                                                      |
         |   Total Cells: 
        579641400                                                  |
         |        Projection: UTM (zone
        18)                                           |
         |            N: 4528864.484212    S: 4503016.5481   Res:
        0.99999753          |
         |            E: 574950.240953    W: 552525.236985   Res:
        1.00000018          |
         |   Range of data:    min =  0.000000 max =
        206.899994                       |
         |                                                                           
        |
         |   Data
        Source:                                                            
        |
         |                                                                           
        |
         |                                                                           
        |
         |                                                                           
        |
         |   Data
        Description:                                                       
        |
         |    generated by r.patch




Source of vectors

Vectors were imported into a location with these specifications:

    name:    State Plane
    datum:   nad83
    dx:      0.000000
    dy:      0.000000
    dz:      0.000000
    proj:    tmerc
    a:       0.63782064e+07
    es:      0.6768657997291094e-02
    x_0:     0.6096012192024384e+06
    y_0:     0
    k:       0.999975e+00
    lon_0:   74d40'w
    lat_0:   38d50'n
    -----------------------------------------------------------
    PROJ_UNITS file:
    unit:    foot
    units:   feet
    meters:  0.3048000000

Source data was an arc/info vector .shp file downloaded from New Jersey DEP
http://www.state.nj.us/dep/gis/digidownload/zips/trct/esstrct.zip

This is the script I used to do the import:

    BASE=/DATA/GIS/NJ/ESSEX
    SHP=esstrct
    g.region rast=essexdem
    cd ${BASE}/$SHP
    for ATT in AREA PERIMETER SUM_TOTALP ; do
      v.in.shape -o in=${SHP}.shp out=${SHP}_$ATT attribute=$ATT scale=24000
      v.support map=${SHP}_$ATT option=build
    done

v.info esstrct_AREA

    +----------------------------------------------------------------------------+
     | Layer:    esstrct_AREA                   Date: Sun Feb 16
    22:44:45         |
     | Mapset:   state1                        
    Organization:                     |
     | Location: NJ_stpln                       Name of
    creator:                  |
     | DataBase:
    /home/pmolzer/grassdata                                          |
     | Title:    Vector map: esstrct_AREA (
    esstrct_AREA)                         |
     |----------------------------------------------------------------------------|
     |                                                                           
    |
     |   Type of Map:  Vector (level: 2)        Number of Categories:
    1           |
     |                                          Number of lines:     
    644         |
     |                                          Number of areas:     
    226         |
     |                                          Number of islands:   
    2           |
     |                                                                           
    |
     |   Projection: State Plane (zone
    0)                                         |
     |            N:     756057    S:    
    670935                                  |
     |            E:     599476    W:    
    526003                                  |
     |                                                                           
    |
     |   Source
    date:                                                             |
     |   Original scale
    1:24000                                                   |
     |   Map threshold: 0.00000


I then bring the vectors into my UTM project like this

    v.proj input=esstrct_AREA location=NJ_stpln mapset=state1
    output=esstrct_AREA
    v.support esstrct_AREA

which gives me:
v.info esstrct_AREA

    +----------------------------------------------------------------------------+
     | Layer:    esstrct_AREA                   Date: Mar 2
    3                     |
     | Mapset:   essex_utm                     
    Organization:                     |
     | Location: NJ_utm                         Name of creator:
    esstrct_AREA     |
     | DataBase:
    /home/pmolzer/grassdata                                          |
     | Title:    Vector map: esstrct_AREA (
    esstrct_AREA)                         |
     |----------------------------------------------------------------------------|
     |                                                                           
    |
     |   Type of Map:  Vector (level: 2)        Number of Categories:
    1           |
     |                                          Number of lines:     
    644         |
     |                                          Number of areas:     
    226         |
     |                                          Number of islands:   
    2           |
     |                                                                           
    |
     |   Projection: UTM (zone
    18)                                                |
     |            N:    4527072    S:   
    4501059                                  |
     |            E:     101524    W:     
    79046                                  |
     |                                                                           
    |
     |   Source
    date:                                                             |
     |   Original scale
    1:24000                                                   |
     |   Map threshold:
    0.00000                                                   |
     |  
    Comments:                                                               
    |
     |     /home/pmolzer/grassdata/NJ_utm/essex_utm/dig_cats

The East and West bounds are totally different than for the DEM, which were
N: 4528864.484212    S: 4503016.5481   Res: 0.99999753   
E: 574950.240953    W: 552525.236985   Res: 1.00000018    

    Thanks,
    Phil





More information about the grass-user mailing list