Merge "Issue #2664 Fix NullPointerException when no .prj file present" into development

Former-commit-id: 77cf9b366c [formerly 3806a1fd05] [formerly 6b226db27c] [formerly 77cf9b366c [formerly 3806a1fd05] [formerly 6b226db27c] [formerly 66929690c7 [formerly 6b226db27c [formerly de57933506ad588c8da38a49de6a2cd5530e2091]]]]
Former-commit-id: 66929690c7
Former-commit-id: 9b5d743027 [formerly 55f31328af] [formerly 8b68cd3c4868310fe8a550a72548e02fe12db72e [formerly cacff76564]]
Former-commit-id: 2d7f18701d5f63bb89fef645311fce21064cd3d0 [formerly 07f66078a4]
Former-commit-id: 3b177c01ce
This commit is contained in:
Ron Anderson 2014-04-17 13:13:03 -05:00 committed by Gerrit Code Review
commit 4e278d2b6b

View file

@ -119,6 +119,7 @@ import com.vividsolutions.jts.geom.Point;
* Feb 18, 2014 #2819 randerso Removed unnecessary clones of geometries
* Mar 11, 2014 #2718 randerso Changes for GeoTools 10.5
* Mar 25, 2014 #2664 randerso Added support for non-WGS84 shape files
* Apr 14, 2014 #2664 randerso Fix NullPointerException when no .prj file present
*
* </pre>
*
@ -611,6 +612,13 @@ public class DataStoreResource extends
schema = dataStore.getSchema(typeName);
CoordinateReferenceSystem incomingCrs = schema
.getGeometryDescriptor().getCoordinateReferenceSystem();
if (incomingCrs == null) {
statusHandler.warn("No projection information found for "
+ dataStore.getFeatureSource(typeName).getName()
.getURI()
+ ", assuming WGS84 unprojected lat/lon.");
incomingCrs = MapUtil.getLatLonProjection();
}
incomingToLatLon = MapUtil.getTransformToLatLon(incomingCrs);
latLonToIncoming = MapUtil.getTransformFromLatLon(incomingCrs);