[GRASS-user] Difficlty with projections - newbie

Hi,
before anyone question my newbie status, I wish to reaffirm it!
I've been reading this list since a long time but never got my hands
dirty working with GRASS.

well, back to the point. or polygon as is the case.

So, The following vector is supposed to be in polyconic projection, as
used in Brasil. The following info came with the vectors:

- Ellipsoid: UGGI 67
- Semi-major axis= 6378.160 km
- Semi-minor axis = 6356.775 km
- Excentricity = 0.0818201799960599
- Flattening = 0.00335289186923715
- Planimetric Datum: South American 1969 - SAD69
- Altimetric Datum: Imbituba

- Origin Latitude: 0º ( Equator);
- Origin Longitude : - 54º (54W).

From what OGR tells me, I believe there is no projection information

on the shapefile:

paulo@onix:~/gis_data/ibge/mapa_indice$ ogrinfo -so
MALHA_MUNICIPAL_2000.shp layer 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:
(unknown)
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)

What I want to do: add the projection information and then re-project
this to lat-lon in order to overlay this on the GLCF shapefiles.

I need some help to glue this all together.

thanks you all.
--
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

On Tue, 20 Jun 2006 23:40:12 -0300
pmarc <paulomarcondes@gmail.com> wrote:

Hi,
before anyone question my newbie status, I wish to reaffirm it!
I've been reading this list since a long time but never got my hands
dirty working with GRASS.

well, back to the point. or polygon as is the case.

So, The following vector is supposed to be in polyconic projection, as
used in Brasil. The following info came with the vectors:

- Ellipsoid: UGGI 67
- Semi-major axis= 6378.160 km
- Semi-minor axis = 6356.775 km
- Excentricity = 0.0818201799960599
- Flattening = 0.00335289186923715
- Planimetric Datum: South American 1969 - SAD69
- Altimetric Datum: Imbituba

- Origin Latitude: 0º ( Equator);
- Origin Longitude : - 54º (54W).

Based on this info, find your epsg code on
http://ocean.csl.co.uk/OceanBrowser/browse.html. If it's there use that
code as -s_srs for ogr2ogr.

Maciek

------------------------------------------------------------------------
CIEPŁE KRAJE - CIEPŁE MORZA. Szukasz atrakcyjnego wypoczynku w przystępnej cenie, zapoznaj się z naszą ofertą.
ZAPRASZAMY

www.skarpatravel.pl

2006/6/21, Maciek Sieczka <werchowyna@epf.pl>:

Based on this info, find your epsg code on
http://ocean.csl.co.uk/OceanBrowser/browse.html. If it's there use that
code as -s_srs for ogr2ogr.

Hi,

grepping /usr/share/proj/epsg, I got this:
paulo@onix:~/gis_data/ibge/mapa_indice$ grep -A 1 Brazil /usr/share/proj/epsg
# SAD69 / Brazil Polyconic
<29100> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000
+ellps=GRS67 +units=m +no_defs <>
# SAD69 / Brazil Polyconic
<29101> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000
+ellps=aust_SA +units=m +no_defs <>

From which I determined EPSG:29100 to be the case, however:

$ 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...
--
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

On Wed, 21 Jun 2006 12:11:55 -0300
pmarc <paulomarcondes@gmail.com> wrote:

2006/6/21, Maciek Sieczka <werchowyna@epf.pl>:
>
> Based on this info, find your epsg code on
> http://ocean.csl.co.uk/OceanBrowser/browse.html. If it's there use
> that code as -s_srs for ogr2ogr.

Hi,

grepping /usr/share/proj/epsg, I got this:
paulo@onix:~/gis_data/ibge/mapa_indice$ grep -A 1
Brazil /usr/share/proj/epsg
# SAD69 / Brazil Polyconic
<29100> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000
+ellps=GRS67 +units=m +no_defs <>
# SAD69 / Brazil Polyconic
<29101> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000
+ellps=aust_SA +units=m +no_defs <>

>From which I determined EPSG:29100 to be the case, however:

$ 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

------------------------------------------------------------------------
CIEP?E KRAJE - CIEP?E MORZA. Szukasz atrakcyjnego wypoczynku w przyst?pnej cenie, zapoznaj si? z nasz? ofert?.
ZAPRASZAMY

www.skarpatravel.pl

2006/6/21, Maciek Sieczka <werchowyna@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