[GRASS-user] Import CH1903 Referenced Geodata

Tom Russo russo at bogodyn.org
Thu Nov 13 16:40:52 EST 2008


On Thu, Nov 13, 2008 at 03:58:34PM -0500, we recorded a bogon-computron collision of the <adrian at waddell.ch> flavor, containing:
> Hello There,
> 
> I'm trying to import the sample shapefile from
> 
> http://www.swisstopo.admin.ch/internet/swisstopo/en/home/products/downloads/landscape/vector25.html


The shapefiles do not come with ".prj" files defining the coordinate system,
so Grass thinks they're just X/Y pairs with no specific projection.  To use 
them, you'll have to either tell GRASS to assume the data is in the same
projection as your location (and be correct that it is), or attach the right
projection information to the data (with some other utility).

> the data import works fine, however I get the following error if I try 
> to change the projection settings:
> 
> XY-location cannot be projected

When you created a new location from the data, it had no idea what projection
to use, so created an X-Y location (undefined projection).

> 
> Does anybody has an idea how to fix this problem?

You need to determine what coordinate system the data really are in (by
finding associated metadata, as for example at http://gbs02.geotaskserver.com/swisstopo/getPresentationRequestResult.do?fileIdentifier=V25_all&profile=GM03Comprehensive&locale=en&format=html#N10351

This metadata, which I got to by following the "Vec25" link under "Products" 
and then clicking the "metadata" link, claims the data is in CH1903 reference 
system.

If you already have a CH1903 (EPSG number 4149) GRASS location, you can import
it to that location with the "-o" option of v.in.ogr, which will ignore the
apparent mismatch in projections --- that apparent mismatch is not real, because
the data itself have no proper indications of their projection, and they
are supposedly already in CH1903 (though they carry no information to signal
that fact to GRASS).  Try using "v.in.ogr -o  " in your CH1903 location,
and you'll probably find that all the data lines up where you expect it to be.

Your other option  is to attach the right coordinate system to the data using
some utility like ogr2ogr (from GDAL):

  ogr2ogr -a_srs EPSG:4149 new_heb_25_l.shp heb_25_l.shp

will copy the shapefile to a new one, but create a .prj file with the CH1903
information in it.  You could import this new shapefile into your CH1903
location without the "-o" option.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
 "Argue for your limitations and sure enough, they're yours."  -- R. Bach





More information about the grass-user mailing list