[GRASS-user] Difficlty with projections - newbie

pmarc paulomarcondes at gmail.com
Wed Jun 21 21:34:33 EDT 2006


2006/6/21, Maciek Sieczka <werchowyna at epf.pl>:
> > $ ogr2ogr -update -append -f "ESRI Shapefile" -s_srs EPSG:29100
> > MALHA_MUNICIPAL_2000.shp
> >
> > only returns the usage pattern of ogr2ogr.
> >
> > I know this isn't really a GRASS issue, but...
>
> You need to specify the target coordinate system, -t_srs, and the
> output shapefile. Note the output name goes first, then input name. All
> there in man ogr2ogr.

Maciek, thanks.
However, for a newbie, the man page should be a bit more verbose.
I'll try to add a bit more info, or rephrase something and then send to Frank.

ogr2ogr -f "ESRI Shapefile" -s_srs EPSG:29100 -a_srs EPSG:29100
malha_municipal_2000.shp MALHA_MUNICIPAL_2000.shp layer
MALHA_MUNICIPAL_2000

did the trick.

Now that I added projection information to my shapefile, I ran

$ ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:4326
Malha_Municipal_2000.shp malha_municipal_2000.shp layer
malha_municipal_2000

to translate it to lat-lon

ERROR 1: geocentric transformation missing z or ellps
Failed to transform feature 0.
ERROR 1: Terminating translation prematurely after failed
translation of layer malha_municipal_2000

OGR knows something about my vector:

$ ogrinfo -so malha_municipal_2000.shp malha_municipal_2000
INFO: Open of `malha_municipal_2000.shp'
using driver `ESRI Shapefile' successful.

Layer name: malha_municipal_2000
Geometry: Polygon
Feature Count: 5726
Extent: (-2205855.200000, -3736283.700000) - (2615330.400000, 586413.000000)
Layer SRS WKT:
PROJCS["SAD69 / Brazil Polyconic",
    GEOGCS["SAD69",
        DATUM["South_American_Datum_1969",
            SPHEROID["GRS 1967",6378160,298.247167427,
                AUTHORITY["EPSG","7036"]],
            AUTHORITY["EPSG","6291"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AUTHORITY["EPSG","4291"]],
    PROJECTION["Polyconic"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-54],
    PARAMETER["false_easting",5000000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","29100"]]
CODIGO_UF: String (25.0)
NOME_MUNIC: String (64.0)
GEOCODIGO_: String (7.0)
AREA_2000: Real (24.5)
LATITUDE_S: Real (24.5)
LONGITUDE_: Real (24.5)
ID: Integer (10.0)
mslink: Integer (10.0)
mapid: Integer (10.0)

One thing that still puzzles me is that I couldn't update the
projection information on the file, I had to create a new file. From
what I understood from the man page, the -update flag would serve this
function.

-- 
Paulo Marcondes = PU1/PU2PIX
-22.915 -42.229 = GG87vc (http://www.amsat.org/cgi-bin/gridconv)
Debian GNU/Linux = http://rj.debianbrasil.org = http://www.debian.org




More information about the grass-user mailing list