[GRASS-user] “Random read is not supported by OGR for this layer, cannot build support.”

Hi, GRASS users! I am a novice, and have only been using this program for a couple of months now. I’m having a problem using GRASS with postgres for a project at work, and I was wondering if you guys could help.

I’m working with shapefiles, and want to display them in GRASS. Some of these files are large enough to crash GRASS while cleaning, and even more take longer to draw and redraw than I’d like. To avoid this, I’m attempting to use v.external to connect to the files in a postGIS table, created using shp2pgsql. When I run v.external, however, I get a strange warning: “Random read is not supported by OGR for this layer, cannot build support.” Then when I try to display the created vector layer, GRASS crashes.

In the GRASS documentation, it mentions adding a unique ID column to the postgres table, but with or without the column the same warning occurs, and the program still crashes. I’m kinda stumped for what to do next, and so I turn to you all for advice. Have you received this warning/crash yourselves, and if so, how was it resolved? Thank you very much.


-Spencer Fogg

Spencer Fogg wrote:

Hi, GRASS users! I am a novice, and have only been using this program for a couple of months now. I'm having a problem using GRASS with postgres for a project at work, and I was wondering if you guys could help.

I'm working with shapefiles, and want to display them in GRASS. Some of these files are large enough to crash GRASS while cleaning, and even more take longer to draw and redraw than I'd like. To avoid this, I'm attempting to use v.external to connect to the files in a postGIS table, created using shp2pgsql. When I run v.external, however, I get a strange warning: "Random read is not supported by OGR for this layer, cannot build support." Then when I try to display the created vector layer, GRASS crashes.

Spencer,

On review of the OGR PostGIS driver I think this is a bug in the driver's
"TestCapabilities" method. Are you in a position to rebuild your GDAL with
a patch? I'd appreciate your filing a bug against GDAL/OGR for this issue,
and we can pursue the discussion there.

   http://trac.osgeo.org/gdal/

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 | President OSGeo, http://osgeo.org

We will pursue this route here at Noblis where Spencer worked over the
summer. Our folks who installed the gdal libraries will be in touch,
probably next week as we will be out of town this week. Thanks for your
quick response.

David A. Garbin
Senior Fellow
Noblis
3150 Fairview Park Dr S
Falls Church, VA 22042
Phone: +1 703.610.2050
Cell: +1 703.795.6010
Email: david.garbin@noblis.org

-----Original Message-----
From: grassuser-bounces@grass.itc.it
[mailto:grassuser-bounces@grass.itc.it] On Behalf Of Frank Warmerdam
Sent: Monday, August 06, 2007 4:00 PM
To: Spencer Fogg
Cc: grassuser@grass.itc.it
Subject: Re: [GRASS-user] "Random read is not supported by OGR for this
layer, cannot build support."

Spencer Fogg wrote:

Hi, GRASS users! I am a novice, and have only been using this program
for a couple of months now. I'm having a problem using GRASS with
postgres for a project at work, and I was wondering if you guys could

help.

I'm working with shapefiles, and want to display them in GRASS. Some

of

these files are large enough to crash GRASS while cleaning, and even
more take longer to draw and redraw than I'd like. To avoid this, I'm
attempting to use v.external to connect to the files in a postGIS

table,

created using shp2pgsql. When I run v.external, however, I get a

strange

warning: "Random read is not supported by OGR for this layer, cannot
build support." Then when I try to display the created vector layer,
GRASS crashes.

Spencer,

On review of the OGR PostGIS driver I think this is a bug in the
driver's
"TestCapabilities" method. Are you in a position to rebuild your GDAL
with
a patch? I'd appreciate your filing a bug against GDAL/OGR for this
issue,
and we can pursue the discussion there.

   http://trac.osgeo.org/gdal/

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 | President OSGeo,
http://osgeo.org

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

We tried the patch to gdal that was suggested, but it did not work. The
PostGIS table is owned by me and has a primary index, but the "Random
read..." error is still reported. I worked around this by modifying the
Vect_build_ogr method (found in lib/vector/Vlib/build_ogr.c) to remove
the test. That solved this problem and the simple topology was built in
GRASS with a link to the database.

I had other problems displaying the table that I was working with, but I
will report that in another thread.

David A. Garbin
Senior Fellow
Noblis
3150 Fairview Park Dr S
Falls Church, VA 22042
Phone: +1 703.610.2050
Cell: +1 703.795.6010
Email: david.garbin@noblis.org

-----Original Message-----
From: grassuser-bounces@grass.itc.it
[mailto:grassuser-bounces@grass.itc.it] On Behalf Of Garbin, David
Sent: Monday, August 06, 2007 3:52 PM
To: Frank Warmerdam; Spencer Fogg
Cc: grassuser@grass.itc.it
Subject: RE: [GRASS-user] "Random read is not supported by OGR for this
layer,cannot build support."

We will pursue this route here at Noblis where Spencer worked over the
summer. Our folks who installed the gdal libraries will be in touch,
probably next week as we will be out of town this week. Thanks for your
quick response.

David A. Garbin
Senior Fellow
Noblis
3150 Fairview Park Dr S
Falls Church, VA 22042
Phone: +1 703.610.2050
Cell: +1 703.795.6010
Email: david.garbin@noblis.org

-----Original Message-----
From: grassuser-bounces@grass.itc.it
[mailto:grassuser-bounces@grass.itc.it] On Behalf Of Frank Warmerdam
Sent: Monday, August 06, 2007 4:00 PM
To: Spencer Fogg
Cc: grassuser@grass.itc.it
Subject: Re: [GRASS-user] "Random read is not supported by OGR for this
layer, cannot build support."

Spencer Fogg wrote:

Hi, GRASS users! I am a novice, and have only been using this program
for a couple of months now. I'm having a problem using GRASS with
postgres for a project at work, and I was wondering if you guys could

help.

I'm working with shapefiles, and want to display them in GRASS. Some

of

these files are large enough to crash GRASS while cleaning, and even
more take longer to draw and redraw than I'd like. To avoid this, I'm
attempting to use v.external to connect to the files in a postGIS

table,

created using shp2pgsql. When I run v.external, however, I get a

strange

warning: "Random read is not supported by OGR for this layer, cannot
build support." Then when I try to display the created vector layer,
GRASS crashes.

Spencer,

On review of the OGR PostGIS driver I think this is a bug in the
driver's
"TestCapabilities" method. Are you in a position to rebuild your GDAL
with
a patch? I'd appreciate your filing a bug against GDAL/OGR for this
issue,
and we can pursue the discussion there.

   http://trac.osgeo.org/gdal/

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 | President OSGeo,
http://osgeo.org

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

I have a PostGIS table that was loaded from a shapefile which contained
multipolygons. I've used v.external to connect to the shapefile
directly and it displays fine. When I use the PG: driver to connect to
the database table, the display crashes when I tell it to Zoom to the
selected map extent. Looking at the underlying SQL commands that
d.frame -e generates, it seems to be using a cursor to FETCH 500 records
at a time, but keeps looping back and fetches the same 500 records over
and over again. The display mechanism works fine using the PG: driver
and a table that contains simple POLYGONS.

David A. Garbin
Senior Fellow
Noblis
3150 Fairview Park Dr S
Falls Church, VA 22042
Phone: +1 703.610.2050
Cell: +1 703.795.6010
Email: david.garbin@noblis.org

-----Original Message-----
From: Garbin, David
Sent: Wednesday, August 22, 2007 10:44 AM
To: Garbin, David; Frank Warmerdam; Spencer Fogg
Cc: grassuser@grass.itc.it
Subject: RE: [GRASS-user] "Random read is not supported by OGR for this
layer, cannot build support."

We tried the patch to gdal that was suggested, but it did not work. The
PostGIS table is owned by me and has a primary index, but the "Random
read..." error is still reported. I worked around this by modifying the
Vect_build_ogr method (found in lib/vector/Vlib/build_ogr.c) to remove
the test. That solved this problem and the simple topology was built in
GRASS with a link to the database.

I had other problems displaying the table that I was working with, but I
will report that in another thread.

David A. Garbin
Senior Fellow
Noblis
3150 Fairview Park Dr S
Falls Church, VA 22042
Phone: +1 703.610.2050
Cell: +1 703.795.6010
Email: david.garbin@noblis.org

-----Original Message-----
From: grassuser-bounces@grass.itc.it
[mailto:grassuser-bounces@grass.itc.it] On Behalf Of Garbin, David
Sent: Monday, August 06, 2007 3:52 PM
To: Frank Warmerdam; Spencer Fogg
Cc: grassuser@grass.itc.it
Subject: RE: [GRASS-user] "Random read is not supported by OGR for this
layer,cannot build support."

We will pursue this route here at Noblis where Spencer worked over the
summer. Our folks who installed the gdal libraries will be in touch,
probably next week as we will be out of town this week. Thanks for your
quick response.

David A. Garbin
Senior Fellow
Noblis
3150 Fairview Park Dr S
Falls Church, VA 22042
Phone: +1 703.610.2050
Cell: +1 703.795.6010
Email: david.garbin@noblis.org

-----Original Message-----
From: grassuser-bounces@grass.itc.it
[mailto:grassuser-bounces@grass.itc.it] On Behalf Of Frank Warmerdam
Sent: Monday, August 06, 2007 4:00 PM
To: Spencer Fogg
Cc: grassuser@grass.itc.it
Subject: Re: [GRASS-user] "Random read is not supported by OGR for this
layer, cannot build support."

Spencer Fogg wrote:

Hi, GRASS users! I am a novice, and have only been using this program
for a couple of months now. I'm having a problem using GRASS with
postgres for a project at work, and I was wondering if you guys could

help.

I'm working with shapefiles, and want to display them in GRASS. Some

of

these files are large enough to crash GRASS while cleaning, and even
more take longer to draw and redraw than I'd like. To avoid this, I'm
attempting to use v.external to connect to the files in a postGIS

table,

created using shp2pgsql. When I run v.external, however, I get a

strange

warning: "Random read is not supported by OGR for this layer, cannot
build support." Then when I try to display the created vector layer,
GRASS crashes.

Spencer,

On review of the OGR PostGIS driver I think this is a bug in the
driver's
"TestCapabilities" method. Are you in a position to rebuild your GDAL
with
a patch? I'd appreciate your filing a bug against GDAL/OGR for this
issue,
and we can pursue the discussion there.

   http://trac.osgeo.org/gdal/

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 | President OSGeo,
http://osgeo.org

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser