[Gdal-dev] OGR and OGDI issues

Markus Neteler neteler at itc.it
Thu Jun 24 06:21:17 EDT 2004


At time I am facing some problems with OGR/OGDI:

I have updated to 
- the current OGDI-CVS
- the current GDAL/OGR-CVS
- Mapserver 4.2.


Following three problems occured:
1) OGDI compiled with external PROJ fails:

  ogr2ogr -t_srs "EPSG:4326" -where "na2 = 'UP'" polbnda_ukraine.shp \
       gltp:/vrf/grass0/warmerdam/v0eur/vmaplv0/eurnasia 'polbnda at bnd(*)_area'
  ERROR 6: Failed to initialize PROJ.4 with `+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs '.
  unknown projection id
  Failed to create coordinate transformation between the
  following coordinate systems.  This may be because they
  are not transformable, or because projection services
  (PROJ.4 DLL/.so) could not be loaded.
  Source:
  GEOGCS["NAD83",
    DATUM["North_American_Datum_1983",
        SPHEROID["GRS 1980",6378137,298.257222101,
            AUTHORITY["EPSG","7019"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6269"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4269"]]
  Target:
  GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

 It is not clear to me if OGDI or OGR is doing the 
 reprojectioning.
 With OGDI compiled with internal (old) PROJ support it
 works. But then it won't do datum transformation, right?

 So far I don't know how to get that working. Any hint
 is appreciated.


2) A related problem: Some field in PostgreSQL seems to be too
   short? I tried to convert VMAP0 data via OGR to PostGIS.
   After a while I got

  ogr2ogr -f PostgreSQL PG:'host=localhost user=postgres dbname=vmap0' \
    gltp:/vrf/grass0/warmerdam/v0eur/vmaplv0/eurnasia \
    -nln polbnda 'polbnda at bnd(*)_area'
  ERROR 1: INSERT command for new feature failed.
  ERROR:  value too long for type character(64)

  ERROR 1: Terminating translation prematurely after failed
  translation of layer polbnda at bnd(*)_area

  Where should I change the field length?


3) Finally, sorry for being so lengthy, MapServer gives following
   error with OGDI-Data (it works well with SHAPE and raster):

   msDrawMap(): Image handling error. Failed to draw layer named 'roadl_africa'.
   msOGRLayerInitItemInfo(): OGR error. Invalid Field name: rtt 

  Since the mapfile [1] is unchanged which worked well before updating
  the software it seems to be related to OGR (I tried Mapserver 4.0 and 4.2).

  But: 
  export OGDI="gltp:/vrf/grass0/warmerdam/v0eur/vmaplv0/eurnasia"
  ogrinfo -ro $OGDI -summary  -sql 'select * from "roadl at trans(*)_line" where rtt=14'
  INFO: Open of `gltp:/vrf/grass0/warmerdam/v0eur/vmaplv0/eurnasia'
  using driver `OGDI' successful.

  Layer name: roadl at trans(*)_line
  Geometry: Line String
  Feature Count: 67350
  Extent: (-10.244722, 45.000000) - (90.167747, 70.484337)
  Layer SRS WKT:
  GEOGCS["NAD83",
  [...]
    AUTHORITY["EPSG","4269"]]
  id: Integer (10.0)
  f_code: String (5.0)
  acc: Integer (5.0)
  exs: Integer (5.0)
  med: Integer (5.0)
  rtt: Integer (5.0)
  tile_id: Integer (5.0)
  edg_id: Integer (10.0)

  Features are found.
  Somehow Mapserver doesn't get the field names any more for 'LABELITEM'.


Excuse me for asking three questions, but they seem to be closely related.

Kind regards

  Markus Neteler

--------------------------------
[1] the Mapfile snippet:

LAYER
 NAME roadl_africa
 GROUP roadl
 TYPE LINE
 CONNECTIONTYPE OGR
 CONNECTION "gltp:/vrf/grass0/warmerdam/v0soa/vmaplv0/soamafr"
 DATA "roadl at trans(*)_line"
 STATUS ON
 CLASS
    EXPRESSION ([rtt] = 14 )
    MAXSCALE 10000000
    SYMBOL "line"
    COLOR 200 20 20
    SIZE 3
    OVERLAYSYMBOL "line"
    OVERLAYCOLOR 250 250 0
    OVERLAYSIZE 1
 END
 [...]



More information about the Gdal-dev mailing list