[GRASS-dev] v.overaly - slow

Hi,

I need to split one big vector file (200MB Shapefile) to several
smaler tiles , so it is more usable for mapserver, and I wrote a small
script v.mktiles, which should split big vector file into several
tiles (attached):

Description:
Splits large vector map into several tiles with associated attribute table

Keywords:
vector, tiles

Usage:
v.mktiles [-c] input=name [type=string] prefix=name columns=value
   rows=value [--overwrite] [--verbose] [--quiet]

Flags:
  -c Make a copy for attribute table for each tile
--o Allow output files to overwrite existing files
--v Verbose module output
--q Quiet module output

Parameters:
    input Name of input vector map
     type Input map type
            options: line,area
            default: line
   prefix Prefix for output vector maps
  columns Resulting number of columns
            default: 2
     rows Resulting number of rows
            default: 2

When the input file is relatively small (spearfish roads), it works fine:

GRASS> v.mktiles in=roads pref=cest columns=2 rows=2 type=line --o

but when I try to run it on file with 155754 isolines, it took an
hour, and even the first tile was not generated

so, my question: is there such script already (maybe something in
GDAL/OGR package, which I missed)? Isn't there any big mistake in my
script?

If desired, in the future the script should take output from v.mkgrid as well

Thanks

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

(attachments)

v.mktiles (3.63 KB)

Jachym:

so, my question: is there such script already (maybe
something in GDAL/OGR package, which I missed)? Isn't there
any big mistake in my script?

to speed it up use v.in.region+v.select before v.overlay, so expensive overlay is only performed on relevant features.

during import you can replicate that with v.in.ogr's -r or spatial= options.

Hamish

hi hamish,

thanks for the hint with v.select

the data was generated in GRASS, so v.in.ogr would not help

thanks

jachym

2008/5/24, Hamish <hamish_b@yahoo.com>:

Jachym:

so, my question: is there such script already (maybe
something in GDAL/OGR package, which I missed)? Isn't there
any big mistake in my script?

to speed it up use v.in.region+v.select before v.overlay, so expensive
overlay is only performed on relevant features.

during import you can replicate that with v.in.ogr's -r or spatial= options.

Hamish

--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub