Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-dev] Batchtool for generation of index files ?

Hi Stephan,

> the following will do the trick :
>
> $java -cp gt-shapefile-8-SNAPSHOT.jar
> org.geotools.data.shapefile.indexed.ShapeFileIndexer path-to-your-shapefile

that means you can also run this from the scripting console, which
might be nice, since directly from uDig.

First you collect your shapefiles in a list and then maybe something like:

shpList.each{ file ->
    new org.geotools.data.shapefile.indexed.ShapeFileIndexer(file)
}

I never used the indexer, so the syntax might be wrong, but it should
be as simple as that.

Cheers,
Andrea

>
> You need the following jars in your path file :
>
> gt-data-8-SNAPSHOT.jar
> gt-main-8-SNAPSHOT.jar
> gt-api-8-SNAPSHOT.jar
> jts-1.12.jar
> gt-referencing-8-SNAPSHOT.jar
> vecmath-1.3.2.jar
> gt-metadata-8-SNAPSHOT.jar
> gt-opengis-8-SNAPSHOT.jar
> jsr-275-1.0-beta-2.jar
>
> regards, Stephan
>
> ________________________________
> Date: Tue, 11 Feb 2014 23:21:20 +1100
> Subject: Re: [udig-dev] Batchtool for generation of index files ?
> From: jody.garnett@xxxxxxxxx
> To: stephandeckers@xxxxxxxxxxx
> CC: udig-dev@xxxxxxxxxxxxxxxx
>
>
> Simply reading the shapefile with GeoTools should create an index (they have
> a connection parameter that can be used to avoid creating an index if you
> want). So if you are a Java developer you could make a quick program using
> GeoTools. If you are familiar with another language you may wish to look at
> GeoScript to accomplish the same goal.
>
>
> Perhaps what you could do is just import the shapefile to the uDig catalog
> (and then right click to count the features or something). As long as it is
> doing that work in the background (and now while trying to draw the screen)
> uDig should remain responsive.
>
>
>
> Jody Garnett
>
>
> On Tue, Feb 11, 2014 at 9:41 PM, Stephan Deckers
> <stephandeckers@xxxxxxxxxxx> wrote:
>
> Hi,
>
> I'm using FME to create ESRI-shapes from Oracle spatial, the resulting
> datasets have become quit big and if uDig encounters a new dataset it will
> try to recreate the indexfile. During this process, data in this dataset is
> not displayed and uDig becomes very unresponsive. Once the indexfile is
> created, everything is fine.
>
> I'm now distributing my newly created indexfiles together with my new
> datafiles to my users, but is there some tool to create these index-files
> outside of uDig, so I can automate this process ?
>
> thanks, Stephan
>
> _______________________________________________
> udig-dev mailing list
> udig-dev@xxxxxxxxxxxxxxxx
> https://locationtech.org/mailman/listinfo/udig-dev
>
>
>
> _______________________________________________
> udig-dev mailing list
> udig-dev@xxxxxxxxxxxxxxxx
> https://locationtech.org/mailman/listinfo/udig-dev
>


Back to the top