[NAS] problem when importing atkis nas data into postgres

Frank Warmerdam warmerdam at pobox.com
Fre Jul 9 09:56:49 EDT 2010


Armin Retterath wrote:
> hello list,
> 
> we tested the import functions with real atkis demo data. a problem 
> occured while import: the structure was generated, but the elements 
> was not imported. the datatype in geometry_columns was GEOMETRY - 
> which qgis doesn't know and may be erroneous.
> maybe s.o. can help.
> 
> we put the demo data into following place:
> http://www.geoportal.rlp.de/metadata/32370000_5590000_32380000_5600000.xml
> 
> download per wget or curl - don't click on the url ;-)
> 
> test system was ubuntu 10.04
> postgres 8.4
> postgis 1.5
> gdal_trunk from today
> 
> command from shell:
> 
> ./ogr2ogr -f "PostgreSQL" PG:"dbname=atkis1nas 
> user=mapbender_user host=localhost port=5433 
> password=mapbender_user" -a_srs EPSG:25832 
> 32370000_5590000_32380000_5600000.xml

Armin,

I have tried a similar load command with the file you reference with good
success. In particular the command I used was:

  ogr2ogr -update PG:dbname=nas -a_srs EPSG:25832 
32370000_5590000_32380000_5600000.xml

The result appears to be a full set of populated layers, reported by ogrinfo
as:

INFO: Open of `PG:dbname=nas'
       using driver `PostgreSQL' successful.
1: ax_historischesbauwerkoderhistorischeeinrichtung (Line String)
2: ax_flugverkehr (Polygon)
3: ax_einrichtungenfuerdenschiffsverkehr (Point)
4: ax_ortslage (Polygon)
5: ax_kommunalesgebiet (Polygon)
6: ax_bauwerkimgewaesserbereich (Line String)
7: ax_strassenachse (Line String)
8: ax_platz (Polygon)
9: ax_leitung (Line String)
10: ax_unlandvegetationsloseflaeche (Polygon)
11: ax_flaechebesondererfunktionalerpraegung (Polygon)
12: ax_gehoelz (Polygon)
13: ax_bahnverkehr (Polygon)
14: ax_bauwerkoderanlagefuersportfreizeitunderholung (Polygon)
15: ax_gewaesserachse (Line String)
16: ax_wohnbauflaeche (Polygon)
17: ax_wasserspiegelhoehe (Point)
18: ax_bahnverkehrsanlage
19: ax_schifffahrtsliniefaehrverkehr (Line String)
20: ax_nullpunkt (Point)
21: ax_abschnitt (Line String)
22: ax_sonstigesbauwerkodersonstigeeinrichtung
23: ax_gewaessermerkmal (Point)
24: ax_friedhof (Polygon)
25: ax_wasserlauf
26: ax_strasse
27: ax_wegpfadsteig (Line String)
28: ax_hoehleneingang (Point)
29: ax_naturumweltoderbodenschutzrecht
30: ax_landwirtschaft (Polygon)
31: ax_flaechezurzeitunbestimmbar (Polygon)
32: ax_fliessgewaesser (Polygon)
33: ax_netzknoten
34: ax_bauwerkimverkehrsbereich
35: ax_sportfreizeitunderholungsflaeche (Polygon)
36: ax_industrieundgewerbeflaeche (Polygon)
37: ax_strassenverkehr (Polygon)
38: ax_turm (Point)
39: ax_bahnstrecke (Line String)
40: ax_gebietsgrenze (Line String)
41: ax_fahrwegachse (Line String)
42: ax_transportanlage (Point)
43: ax_tagebaugrubesteinbruch (Polygon)
44: ax_vegetationsmerkmal
45: ax_gebaeude (Point)
46: ax_strassenverkehrsanlage (Point)
47: ax_flaechegemischternutzung (Polygon)
48: ax_gewaesserstationierungsachse (Line String)
49: ax_wald (Polygon)
50: ax_denkmalschutzrecht (Point)
51: ax_ast (Line String)
52: ax_wohnplatz (Point)
53: ax_bauwerkoderanlagefuerindustrieundgewerbe (Point)
54: ax_fahrbahnachse (Line String)
55: alkis_beziehungen
56: ax_stehendesgewaesser (Polygon)

Of the above, only those with no geometry type in brackets are declared
as "GEOMETRY" in the GEOMETRY_COLUMNS table and this is because they
contain a mix of geometry types or no geometries at all.  Hmm, on
examination all the ones I looked at have no geometries and were
represented in the original NAS file as "None" geometry type.  It
might be nice to preserve this interpretation in Postgis - a failing
of the OGR PostGIS driver.

I'm not sure why you had problems, though you might try using
-update instead of -f PostgreSQL to indicate loading into an
existing database (making sure it is clean to start).

Sorry to not respond in German, but all my knowledge of German is
built on translate.google.com.  :-)

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent