[GRASSLIST:6822] Re: Converting shapefiles from wrong coordinates

Brent Wood b.wood at niwa.co.nz
Thu May 19 18:15:24 EDT 2005



Hi Paulo,

One approach which might work for you is briefly described below. If you
want to pursue them and would like more info, let me know....



On Thu, 19 May 2005, Paulo Marcondes wrote:

> Guys,
>
> I got many shapefiles from the IBGE (Brazilian Mapping Agency) which
> are in completely wrong coordinates:
>
> I have two situations:
> 1. SHP in lat-lon non-projected, but with coordinate values in 1.2E6
> scale, where it should read 12...
>

As far as this one goes, you can script up something with the shapelib
utility shpdump to extract the shp data to ascii, reformat (awk?) and use
shpcreate/shpadd to reload the data into new shpfiles. The feature order
won't change, so you shouldn't need to touch the dbf files, although if
you have problems you can use the dbfdump & dbfcreate/dbfadd commands to
rebuild these as well.

see: http://shapelib.maptools.org

(The use of the command line for the coord list in the default shpadd
utility is a limitation for features with a large number of coordinates
but I have a modified version which can read them from a file instead)

Not really an elegant solution, but effective enough. If your programming
skills are up to it I understand you could use the shapelib libraries to
do the whole thing in C without scripting.



> 2. DGN (argh!) in UTM projection (SAD69, Corrego Alegre, Meridian -45
> ) but coordinates in km instead of metres.

see http://ogr.maptools.org/drv_dgn.html

If you can read the files OK with ogr2ogr you can convert to shapefile and
use the same approach as above.

I think GRASS may be overkill, even if it can do this. Once you have
shapefiles, you may find QGIS (which can also be used with GRASS data) a
useful tool.


Brent Wood


>
> Currently I am using some commercial GIS to export those shapes in (1)
> to DXF then another commecial CAD to fix'em then import the to the
> previous commercial GIS.
>
> I don't like this approach, because it either:
> - delay my learning of proper GIS techniques
> - rely on non-free software
> - leaves me far from GRASS
>
> Currently I have GRASS running on Cygwin, but as soon as I fix my
> Debian, I'll get GRASS running there too. I have yet to explore the
> spearfish data.
>
> BTW, I have no previous experience with GRASS. Was not able even to
> create a project.
>
> So, obviosly I  want some help in how to deal with that. I like trial
> an error, so, just a few pointers to relevant places shall suffice for
> the moment.
>
> thanks.
>
>
> --
> Paulo Marcondes
> wanabe GRASS-GIS user
> zpaulomarcondesz at gmail period comz
> my email has no z
>
>




More information about the grass-user mailing list