[gdal-dev] ogrinfo wildchar in the datasource?

Moskovitz, Bob Bob.Moskovitz at conservation.ca.gov
Tue Oct 26 12:51:20 EDT 2010


Sebastian,

 

Why not create a script to find all the files and pass it to ogrinfo.
For instance, if I wanted to run ogrinfo on all shapefiles in mydata,
you can do something like this little bash script:

 

for shapefile in `find mydata -name "*.shp"`

do

ogrinfo   -al  -so $shapefile

                done

 

Bob

 

 

Bob Moskovitz

Seismic Hazards Mapping Program

California Geological Survey

 

CONFIDENTIALITY NOTICE: This communication is intended only for the use
of the individual or entity to which it is addressed. This message
contains information from the State of California, California Geological
Survey, which may be privileged, confidential and exempt from disclosure
under applicable law, including the Electronic Communications Privacy
Act. If the reader of this communication is not the intended recipient,
you are hereby notified that any dissemination, distribution, or copying
of this communication is strictly prohibited.

 

 

 

 

From: gdal-dev-bounces at lists.osgeo.org
[mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Sebastian E.
Ovide
Sent: Tuesday, October 26, 2010 9:36 AM
To: Frank Warmerdam
Cc: gdal-dev
Subject: Re: [gdal-dev] ogrinfo wildchar in the datasource?

 

...probably I will copy (or move) all the files under the same folder...
I do not like too much this approach... as I would prefer to maintain
the original directory hierarchy...  but it will make its job...

On Tue, Oct 26, 2010 at 5:25 PM, Frank Warmerdam <warmerdam at pobox.com>
wrote:

Sebastian E. Ovide wrote:


Hi All,

Is there anyway to make gdal read from multiple folders ? something like
ogrinfo mydata/* ? where mydata has a lot of subfolders and any of those
subfolders have shape files.

(I have some folders with tens of folders with shape files that I need
to display with to MapServer. Just wondering if I need to create a
script or if there is a shortcut...)

 

Sebastian,

This would have to be something supported by the shapefile driver in
this
case, and it supports two configurations.  One where the datasource is a
file (one of .shp or.shx) in which case it provides one layer.  The
other
configuration is where a directory is given as the datasource name in
which case it provides one layer per .shx/shp/dbf set in the directory.

There is no mechanism existing now to do what you want short of
constructing
a complicated virtual file collecting several directory based shapefile
datasources.   This approach would not be helpful to you, I think.

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




-- 
Sebastian E. Ovide




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20101026/8942a3b5/attachment.html


More information about the gdal-dev mailing list