Hi Christian

Thanks for your response.  I have already looked through the geoserver
tutorial but I am not using geoserver, what do I need to do get the same
sort of functionality with a JMapPane?  I don't have a log file because I
can't get it to work yet.

I have pregeneralized my shapefile using the toolbox:

 java -jar gt-feature-pregeneralized-2.6.1.jar generalize roads50.shp shapes
5.0,10.0,20.0,50.0

I created a GeneralizationInfos configuration file (geninfo_shapefile.xml):

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

I wrote some code to create a pregeneralized data store and this seems to
work OK:

  private DataStore createPregeneralizedDataStore()
  {
    DataStore ds = null;
    Repository repo = new DSFinderRepository();
    GeneralizationInfosProvider provider = new
GeneralizationInfosProviderImpl();
    GeneralizationInfos infos = null;
    FeatureSource<SimpleFeatureType, SimpleFeature> fs = null;
    try {
      URL url = MyClass.class.getResource("/shapes/geninfo_shapefile.xml");
      infos = provider.getGeneralizationInfos(url);
      ds = new PreGeneralizedDataStore(infos,repo);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return ds;
  }

What I am missing is how to join it all together so that the data store is
used when the JMapPane is zoomed in and out.  Do you have example code of
how to do this?

Thanks,
Richard
-- 
View this message in context: 
http://n2.nabble.com/Shapefile-pregeneralization-tp4867089p4870903.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