I have submitted OGR support to vector library, it is using also the
work previously done by Piero Cavalieri.
frmt format:
FORMAT: ogr
DSN: <DSN>
LAYER: <DEFANGED_Layer name>
example GML:
FORMAT: ogr
DSN: /gdata/ogr/test2.gml
LAYER: test
example Shapefile:
FORMAT: ogr
DSN: /gdata/suolo/shp
LAYER: uso_suolo
example PostGIS:
FORMAT: ogr
DSN: PG:dbname=pgtest
LAYER: uso_suolo
I have tested only Shapefile, GML and PostGIS. Results are very bad.
For GRASS, random access and stable FID are essential.
Unfortunately GML and PostGIS do not support random access currently
and FID may change for PostGIS if OGC_FID does not exist.
d.vect with Shapefile via OGR takes 50 second and
5 seconds for GRASS native format.
It seems that direct OGR access does not have practical meaning,
however, it is good for 'marketing'.
Please test it in any case, especially with other formats.
I am going to write OGR DB driver.
Radim
I added also OGR DBMI driver, but there is a problem,
I wanted to use FID (feature ID) as GRASS category, unfortunately
FID may be 0, in GRASS, category = 0 is the same as no category,
so I used FID+1 in vector library, but I forgot that it cannot
work in the driver.
Any idea how to solve this?
Radim
On Friday 07 May 2004 11:08, Radim Blazek wrote:
I have submitted OGR support to vector library, it is using also the
work previously done by Piero Cavalieri.
frmt format:
FORMAT: ogr
DSN: <DSN>
LAYER: <DEFANGED_Layer name>
example GML:
FORMAT: ogr
DSN: /gdata/ogr/test2.gml
LAYER: test
example Shapefile:
FORMAT: ogr
DSN: /gdata/suolo/shp
LAYER: uso_suolo
example PostGIS:
FORMAT: ogr
DSN: PG:dbname=pgtest
LAYER: uso_suolo
I have tested only Shapefile, GML and PostGIS. Results are very bad.
For GRASS, random access and stable FID are essential.
Unfortunately GML and PostGIS do not support random access currently
and FID may change for PostGIS if OGC_FID does not exist.
d.vect with Shapefile via OGR takes 50 second and
5 seconds for GRASS native format.
It seems that direct OGR access does not have practical meaning,
however, it is good for 'marketing'.
Please test it in any case, especially with other formats.
I am going to write OGR DB driver.
Radim
_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5
Radim Blazek wrote:
I added also OGR DBMI driver, but there is a problem,
I wanted to use FID (feature ID) as GRASS category, unfortunately
FID may be 0, in GRASS, category = 0 is the same as no category,
so I used FID+1 in vector library, but I forgot that it cannot
work in the driver.
Any idea how to solve this?
Radim,
I'm not sure what is the problem with using FID+1. Could you explain
why this does not "work in the driver"?
As previously noted, many OGR formats are not suitable for random access,
and some do not have stable FIDs, though in some cases this is a bug that
could be corrected.
I'm not sure why the performance was so bad with shapefiles. Generally,
random access to shapefiles via FID should be relatively fast. It would
be interesting to see what is making this slow.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
On Monday 10 May 2004 18:02, Frank Warmerdam wrote:
Radim,
I'm not sure what is the problem with using FID+1. Could you explain
why this does not "work in the driver"?
In GRASS, geometry and attributes are linked via "category", if I use
category=FID+1 for geometry, it is impossible to select feature attributes
by SQL query "select * from xxx where FID=<category>".
I have enabled category = 0, so now it works.
I'm not sure why the performance was so bad with shapefiles. Generally,
random access to shapefiles via FID should be relatively fast. It would
be interesting to see what is making this slow.
Sorry, it was my bug in GRASS, features are cached, but I forgot to change
ID of cached feature, so the feature was read for each feature part.
Now, the time for Shapefile is almost the same as for native format.
real 0m4.453s Shapefile via OGR
real 0m3.714s GRASS native
Radim
On Friday 07 May 2004 11:08, Radim Blazek wrote:
Unfortunately GML and PostGIS do not support random access currently
and FID may change for PostGIS if OGC_FID does not exist.
Thanks to Frank Warmedarm! Random access is now available for
PostGIS if OGC_FID exists (GDAL CVS).
Radim