Hi Christian

I still haven't got this to work.  Perhaps I am not creating the
pregeneralized shape files correctly.  When I attempt to load a
pregeneralized shape file into a JMapPane I get the following stack trace:

java.lang.ArrayIndexOutOfBoundsException: 4
        at
org.geotools.geometry.jts.Decimator.decimateTransformGeneralize(Decimator.java:327)
        at
org.geotools.geometry.jts.Decimator.decimateTransformGeneralize(Decimator.java:176)
        at org.geotools.geometry.jts.LiteShape2.<init>(LiteShape2.java:158)
        at
org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getTransformedShape(StreamingRenderer.java:2597)
        at
org.geotools.renderer.lite.StreamingRenderer$RenderableFeature.getShape(StreamingRenderer.java:2545)
        at
org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:2030)
        at
org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:1965)
        at
org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1857)
        at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1770)
        at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:690)
        at
org.geotools.swing.RenderingExecutor$Task.call(RenderingExecutor.java:148)
        at
org.geotools.swing.RenderingExecutor$Task.call(RenderingExecutor.java:104)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

I am attempting to pregeneralize a standard esri shape file containing roads
(roads50.shp).  I based my config file on the example
'geninfo_shapefile.xml' in the
modules\plugin\feature-pregeneralized\src\test\resources directory:

<?xml version="1.0" encoding="UTF-8"?>
<GeneralizationInfos version="1.0">
        <GeneralizationInfo dataSourceName="file:target/0/streams.properties" 
featureName="GenStreams" baseFeatureName="streams"
geomPropertyName="the_geom">
                <Generalization dataSourceName="file:target/5.0/streams.shp"  
distance="5"
featureName="streams" geomPropertyName="the_geom"/>
                <Generalization dataSourceName="file:target/10.0/streams.shp" 
distance="10" featureName="streams" geomPropertyName="the_geom"/>
                <Generalization dataSourceName="file:target/20.0/streams.shp" 
distance="20" featureName="streams" geomPropertyName="the_geom"/>
                <Generalization dataSourceName="file:target/50.0/streams.shp" 
distance="50" featureName="streams" geomPropertyName="the_geom"/>               
        </GeneralizationInfo>
</GeneralizationInfos>

I have a few questions:
- I was unable to locate the 'file:target/0/streams.properties' file, I
image that it contains some database connection properties.  I have used a
URI to my original shape file instead, is that OK?
- Can the 'featureName' value (GenStreams) be any name or is it based on
some value within the original shape file?
- Can the 'baseFeatureName' value (streams) be any name or is it based on
some value within the original shape file?

The version of the config file I'm using is shown above in my original post.

Thanks,
Richard

-- 
View this message in context: 
http://n2.nabble.com/Shapefile-pregeneralization-tp4867089p4877430.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to