Permalink
Browse files

metadata flag to trigger bounds recalculation

This is useful because when an empty bounds is set and the user modifies
the layer, it gets set to something other than empty bounds, even though
the user didn't touch the bounds in the ui. This forces recalculation
regardless.
  • Loading branch information...
1 parent 4b4767b commit e7fa2b31b2d8452eaf71d5853f39b76dafd1a607 @rmarianski rmarianski committed Oct 15, 2012
View
3 importer/src/main/java/org/opengeo/data/importer/Importer.java
@@ -776,7 +776,8 @@ void doIndirectImport(ImportTask task, ImportFilter filter) throws IOException {
// the result of a transform. there may be another way...
FeatureTypeInfo resource = getCatalog().getResourceByName(
featureType.getQualifiedName(), FeatureTypeInfo.class);
- if (resource.getNativeBoundingBox().isEmpty()) {
+ if (resource.getNativeBoundingBox().isEmpty()
+ || resource.getMetadata().get("recalculate-bounds") != null) {
// force computation
CatalogBuilder cb = new CatalogBuilder(getCatalog());
ReferencedEnvelope nativeBounds = cb.getNativeBounds(resource);
View
1 importer/src/main/java/org/opengeo/data/importer/format/KMLFileFormat.java
@@ -274,6 +274,7 @@ public SimpleFeatureType convertParsedFeatureType(SimpleFeatureType ft, String n
resource.setNativeCRS(KML_CRS);
resource.setNativeBoundingBox(EMPTY_BOUNDS);
resource.setLatLonBoundingBox(EMPTY_BOUNDS);
+ resource.getMetadata().put("recalculate-bounds", Boolean.TRUE);
Map<Object, Object> userData = featureType.getUserData();
if (userData.containsKey("schemaname")) {

0 comments on commit e7fa2b3

Please sign in to comment.