Revision: 5574
http://sourceforge.net/p/jump-pilot/code/5574
Author: ma15569
Date: 2017-11-19 10:28:51 +0000 (Sun, 19 Nov 2017)
Log Message:
-----------
improvement on checking tables
Modified Paths:
--------------
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/gui/OpenJUMPInputFactory.java
Modified:
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/gui/OpenJUMPInputFactory.java
===================================================================
---
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/gui/OpenJUMPInputFactory.java
2017-11-19 00:36:10 UTC (rev 5573)
+++
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/gui/OpenJUMPInputFactory.java
2017-11-19 10:28:51 UTC (rev 5574)
@@ -173,24 +173,37 @@
* @return
*/
+// public static boolean isTable(Layer layer) {
+ // FeatureCollectionWrapper featureCollection = layer
+ // .getFeatureCollectionWrapper();
+ // List featureList = featureCollection.getFeatures();
+ // Geometry nextGeo = null;
+ // for (@SuppressWarnings("unchecked")
+ // Iterator<FeatureCollectionWrapper> i = featureList.iterator(); i
+ // .hasNext();) {
+ // Feature feature = (Feature) i.next();
+ // nextGeo = feature.getGeometry();
+ // }
+ // if (!featureCollection.isEmpty() && nextGeo.isEmpty()) {
+ // return true;
+ // } else {
+ // return false;
+ // }
+ // }
+
+ //[Giuseppe Aruta 2017_11_19, got from from Michael's correction bug
+ // #466 Wierd behaviour gettin envelope from a geometry
+
public static boolean isTable(Layer layer) {
- FeatureCollectionWrapper featureCollection = layer
- .getFeatureCollectionWrapper();
- List featureList = featureCollection.getFeatures();
- Geometry nextGeo = null;
- for (@SuppressWarnings("unchecked")
- Iterator<FeatureCollectionWrapper> i = featureList.iterator(); i
- .hasNext();) {
- Feature feature = (Feature) i.next();
- nextGeo = feature.getGeometry();
- }
- if (!featureCollection.isEmpty() && nextGeo.isEmpty()) {
+ Envelope env = layer.getFeatureCollectionWrapper().getEnvelope();
+ if (env.isNull()) {
return true;
} else {
return false;
}
}
-
+
+
public NamedExtent[] getPredefinedExtents() {
return new NamedExtent[0];
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel