[NAS] Erfahrungen mit kreisweiter Datenbank
Frank Warmerdam
warmerdam at pobox.com
Fre Feb 4 09:16:35 EST 2011
On 11-02-04 06:53 AM, "Jäger, Frank (KRZ)" wrote:
> Can ogr2ogr read zipped NAS(XML)-Files?
Frank,
Yes, GDAL/OGR can normally transparently read from zip files.
eg.
ogrinfo /vsizip/fl.zip/flurst_zuhak.xml
So the trick is to prefix the path to the .zip file with
/vsizip/ and then treat the file inside the zip file as an
added part of the path. There is some more info at:
http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip
Note that when used this way it is not possible to safe the .gfs
file caching the schema information so each open of a NAS file
will result in a full scan of it to rebuild the corresponding
information.
> If a NAS-file is konverted twice into the same Database, then PostNAS does this "without error".
> But ...
> the column "gml_id" is a wold-wide-Unique-Key for every object in ALKIS.
> Maybe this is also a great (UNIQUE) Primary Key for every table, and a serial becomes obsolete.
>
> I try to change the database: CREATE UNIQUE INDEX ... (gml_id);
OGR does not use the gml_id as it's internal feature id because OGR's
feature id's must be (32bit) integers. However, it entirely makes sense
in the transfer of the information to Postgres to discard the per file
ogc_fid (really just an OGR generated identifier) and use instead the
gml_id as the primary key. I am afraid I am vague on how the loading
to postgres is done now with PostNAS - is it with the OGR PostGIS driver?
If so, it would be somewhat hard to omit the ogc_fid on load and use
the gml_id instead, and perhaps things need to be done as a post
processing step. I get the impression that is what you are doing now
with some problems?
If you are loading the data more directly then the load step would be
a good point at which to use the gml_id as the primary key.
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