Feature Rendering Layer with User-Defined CRS
---------------------------------------------
Key: UDIG-1818
URL: https://jira.codehaus.org/browse/UDIG-1818
Project: uDIG
Issue Type: Bug
Components: application
Affects Versions: UDIG 1.2.3
Environment: Java 1.6, XP
Reporter: Emily Gouge
If I load a shapefile without a projection; then set the projection in uDig
(right click -> Properties -> Projection) the layer does not render properly.
To reproduce:
1. Load a shapefile without a .prj file.
2. Set the layer projection.
3. Set the map projection to be the same as the layer projection & zoom to
your layer. This works and displays the layer.
4. Set the map projection to something else. The layer no longer renders.
I found in the BasicFeatureRenderer these lines (from the prepareDraw) function
were commented out:
FeatureCollection<SimpleFeatureType, SimpleFeature> reprojectingFc = new
ForceCoordinateSystemFeatureResults(featureSource.getFeatures(),
layer.getCRS());
layers[0] = new DefaultMapLayer(reprojectingFc, style, "Test");
and replaced with this:
layers[0] = new DefaultMapLayer(featureSource, style, "Test"); DefaultQuery
query = new DefaultQuery(Query.ALL);
query.setTypeName(featureSource.getSchema().getTypeName());
query.setCoordinateSystem(layerCRS);
layers[0].setQuery(query);
If I un-do this change then the layer renders fine.
I believe there are multiple issues with this new code:
1) Further in the execution process the query set here is replaced with a new
one that does not keep the projection
2) When geotools render goes to evaluate the query, it first runs a filter on
the data (using a bounding box) then applies the filter. This means that the
filter is being run using the original CRS provided on the layer (or null in
the example above).
I think we need to revert this code back to the original code.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel