[R-sig-Geo] Problems with readOGR

Roger Bivand Roger.Bivand at nhh.no
Wed Jun 26 14:05:32 CEST 2013


On Wed, 26 Jun 2013, Renger van Nieuwkoop wrote:

> Hi
>
> I tried running the following code using the shapefiles for the city of 
> Zurich
>
> require("rgdal") # requires sp, will use proj.4 if installed
> require("maptools")
>
> zh = readOGR(".",layer="Zurich")
> and got following error:
> OGR data source with driver: ESRI Shapefile
> Source: ".", layer: "Zurich"
> with 34 features and 6 fields
> Feature type: wkbPolygon with 2 dimensions
> Fehler in CRS(p4s) : lat_0 = 0 or 90 or alpha = 90
>

See:

http://osgeo-org.1560.x6.nabble.com/Re-Swiss-CORINE-Bessel-1841-Hotine-Oblique-Mercator-Azimuth-Natural-Origin-td3842640.html

Here alpha = 90,

http://trac.osgeo.org/proj/wiki/GenParms#Parameterlist

+alpha     ? Used with Oblique Mercator and possibly a few others

The resolution in the thread:

ogr2ogr shp_dir/ -s_srs epsg:21781 -t_srs epsg:3035 clcbn85p.shp

gets from an alternative encoding to LAEA, you may rather need to impose 
the CRS (delete the offending *.prj file, and impose after reading - but 
be sure to impose the right CRS). Read the whole thread on the PROJ.4 
list, and go back to Cliff Mugnier's Grids & Datums piece in 2001 too. 
This is a particularly contentious set of projection arguments, and there 
are many other Oblique Mercator threads on that list.

Hope this helps,

Roger

>
> ogrInfo gives me this:
>
> ogrInfo(".","Zurich")
>
> Source: ".", layer: "Zurich"
>
> Driver: ESRI Shapefile number of rows 34
>
> Feature type: wkbPolygon with 2 dimensions
>
> Extent: (676227 241585) - (689671 254305.7)
>
> CRS: +proj=omerc +lat_0=46.95240555555556 +lonc=7.439583333333333 +alpha=90 +k=1 +x_0=-9419820.590700001 +y_0=200000 +ellps=bessel +units=m +no_defs
>
> LDID: 87
>
> Number of fields: 6
>
>        name type length typeName
>
> 1    GMDEQNR    0      7  Integer
>
> 2         NR    0      9  Integer
>
> 3       NAME    4     45   String
>
> 4       GMDE    0      9  Integer
>
> 5 FLAECHE_HA    0      9  Integer
>
> 6   Quartier    0      4  Integer
>
>
> I can see that lat_0 is not equal to zero, but don't know how to resolve 
> this issue.
>
> Thanks in advance for help
>
> Renger
>
>
> _________________________________________
> Renger van Nieuwkoop
> Centre for Energy Policy and Economics, ETH
> Z?richbergstrasse 18 (ZUE)
> CH - 8032 Z?rich
> +41 44 632 02 63
> mailto: rengerv at etzh.ch<mailto:rengerv at etzh.ch>
> blog.modelworks.ch
>
>
> 	[[alternative HTML version deleted]]
>
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list