Aah, I  think I got your problem. A Query Object with a hint  
Hints.GEOMETRY_DISTANCE must be used. For geoserver, the rendering  
engine calculates this hint. I assume, JMapPane does not have this  
logic.

@Michael,Ian  is this right ?

The Geometry Distance is calculated from DPI, pixel dimension and  
world coordinates, telling how large a pixel is in real world units  
(meter).

The logic for this is already in the  geoserver renderer. I assume  
this is a new requirement for JMapPane.

I do not know JMapPane, look at

http://svn.osgeo.org/geotools/trunk/modules/plugin/feature-pregeneralized/src/test/java/org/geotools/data/gen/AbstractPreGeneralizedFeatureSourceTest.java

All tests start with obtaining a Pregeneralized Data Store (that is  
the point where you are).

Look at the methods

testFeatureReader
testGetFeatures
testGetFeatures2
testGetFeatures3

Perhaps there is possibility to code a workaround ?







Quoting Richard Marshall <[email protected]>:

>
> 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
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



------------------------------------------------------------------------------
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