polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [45/50] [abbrv] zest-qi4j git commit: Final cleanup
Date Fri, 17 Apr 2015 16:46:32 GMT
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialConfiguration.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialConfiguration.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialConfiguration.java
index d9c37ff..7bd5300 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialConfiguration.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialConfiguration.java
@@ -18,55 +18,68 @@ import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
 
-/**
- * Created by jj on 22.12.14.
- */
-public class SpatialConfiguration {
 
-    public static boolean isEnabled(Configuration config) {
+public class SpatialConfiguration
+{
+
+    public static boolean isEnabled(Configuration config)
+    {
         return config.Enabled().get().booleanValue();
     }
 
-    public static INDEXING_METHOD getMethod(Configuration config) {
+    public static INDEXING_METHOD getMethod(Configuration config)
+    {
         return config.Indexer().get().Method().get().Type().get();
     }
 
-    public static boolean isMethodGeoPoint(Configuration config) {
+    public static boolean isMethodGeoPoint(Configuration config)
+    {
         return config.Indexer().get().Method().get().Type().get() == INDEXING_METHOD.GEO_POINT ? true : false;
     }
 
-    public static boolean isMethodGeoShape(Configuration config) {
+    public static boolean isMethodGeoShape(Configuration config)
+    {
         return config.Indexer().get().Method().get().Type().get() == INDEXING_METHOD.GEO_SHAPE ? true : false;
     }
 
-    public static boolean isIndexerProjectionConversionEnabled(Configuration config) {
+    public static boolean isIndexerProjectionConversionEnabled(Configuration config)
+    {
         return config.Indexer().get().Projection().get().ConversionEnabled().get().booleanValue();
     }
 
-    public static double getIndexerProjectionConversionAccuracy(Configuration config) {
+    public static double getIndexerProjectionConversionAccuracy(Configuration config)
+    {
         // return config.Indexer().get().Projection().get().
         return 2;
     }
 
-    public static String getIndexerPrecision(Configuration config) {
+    public static String getIndexerPrecision(Configuration config)
+    {
         return config.Indexer().get().Method().get().Precision().get();
     }
 
-    public static boolean isFinderProjectionConversionEnabled(Configuration config) {
+    public static boolean isFinderProjectionConversionEnabled(Configuration config)
+    {
         return config.Finder().get().Projection().get().ConversionEnabled().get().booleanValue();
     }
 
-    public static double getFinderProjectionConversionAccuracy(Configuration config) {
+    public static double getFinderProjectionConversionAccuracy(Configuration config)
+    {
         return 2;
     }
 
-    public String getMethodAccuracy(Configuration config) {
+    public String getMethodAccuracy(Configuration config)
+    {
         return config.Indexer().get().Method().get().Precision().get();
     }
 
-    public static enum INDEXING_METHOD {GEO_POINT, GEO_SHAPE}
+    public static enum INDEXING_METHOD
+    {
+        GEO_POINT, GEO_SHAPE
+    }
 
-    public interface Configuration extends ValueComposite {
+    public interface Configuration extends ValueComposite
+    {
         @Optional
         Property<Boolean> Enabled();
 
@@ -77,7 +90,8 @@ public class SpatialConfiguration {
         Property<FinderConfiguration> Finder();
     }
 
-    public interface IndexerConfiguration extends ValueComposite {
+    public interface IndexerConfiguration extends ValueComposite
+    {
         @Optional
         Property<IndexingMethod> Method();
 
@@ -85,12 +99,14 @@ public class SpatialConfiguration {
         Property<ProjectionSupport> Projection();
     }
 
-    public interface FinderConfiguration extends ValueComposite {
+    public interface FinderConfiguration extends ValueComposite
+    {
         @Optional
         Property<ProjectionSupport> Projection();
     }
 
-    public interface IndexingMethod extends ValueComposite {
+    public interface IndexingMethod extends ValueComposite
+    {
         @Optional
         Property<INDEXING_METHOD> Type();
 
@@ -98,7 +114,8 @@ public class SpatialConfiguration {
         Property<String> Precision();
     }
 
-    public interface ProjectionSupport extends ValueComposite {
+    public interface ProjectionSupport extends ValueComposite
+    {
         @Optional
         Property<Boolean> ConversionEnabled();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialFunctionsSupportMatrix.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialFunctionsSupportMatrix.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialFunctionsSupportMatrix.java
index fdc29ba..90810f3 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialFunctionsSupportMatrix.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/configuration/SpatialFunctionsSupportMatrix.java
@@ -28,13 +28,11 @@ import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 
-/**
- * Created by jj on 22.12.14.
- */
-public class SpatialFunctionsSupportMatrix {
+public class SpatialFunctionsSupportMatrix
+{
+    private static final Table<String, SpatialConfiguration.INDEXING_METHOD, ConfigurationEntry> SPATIAL_SUPPORT_MATRIX = HashBasedTable.create();
     private static Boolean OrderBy = true;
     private static Class<? extends TGeometry> AnyGeometry = TGeometry.class;
-    private static final Table<String, SpatialConfiguration.INDEXING_METHOD, ConfigurationEntry> SPATIAL_SUPPORT_MATRIX = HashBasedTable.create();
 
     static
     {
@@ -53,22 +51,22 @@ public class SpatialFunctionsSupportMatrix {
     }
 
 
-    public static boolean isSupported(Class expression, Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method, Boolean verifyOrderBy) {
-        System.out.println(SPATIAL_SUPPORT_MATRIX.toString());
+    public static boolean isSupported(Class expression, Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method, Boolean verifyOrderBy)
+    {
 
-        System.out.println("isSupported " + expression + " " + geometryOfProperty + " " + geometryOfFilter + " Type " + method);
-        System.out.println("Contains " + SPATIAL_SUPPORT_MATRIX.contains(expression.getName(), method));
         if (SPATIAL_SUPPORT_MATRIX.contains(expression.getName(), method))
             return SPATIAL_SUPPORT_MATRIX.get(expression.getName(), method).isSupported(geometryOfProperty, geometryOfFilter, orderBy, verifyOrderBy);
         else
             return false;
     }
 
-    public static boolean isSupported(Class expression, Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, SpatialConfiguration.INDEXING_METHOD method) {
+    public static boolean isSupported(Class expression, Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, SpatialConfiguration.INDEXING_METHOD method)
+    {
         return isSupported(expression, geometryOfProperty, geometryOfFilter, false, method, false);
     }
 
-    private static void supports(Class expression, Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method) {
+    private static void supports(Class expression, Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method)
+    {
         supports
                 (
                         expression,
@@ -78,54 +76,63 @@ public class SpatialFunctionsSupportMatrix {
                 );
     }
 
-    private static void supports(Class expression, Class<? extends TGeometry>[] geometriesOfProperty, Class<? extends TGeometry>[] geometriesOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method) {
+    private static void supports(Class expression, Class<? extends TGeometry>[] geometriesOfProperty, Class<? extends TGeometry>[] geometriesOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method)
+    {
         SPATIAL_SUPPORT_MATRIX.put(expression.getName(), method, new ConfigurationEntry(geometriesOfProperty, geometriesOfFilter, orderBy, method));
     }
 
-    private static Class disable(Class clazz) {
+    private static Class disable(Class clazz)
+    {
         return Object.class;
     }
 
-    private static Class enable(Class clazz) {
+    private static Class enable(Class clazz)
+    {
         return clazz;
     }
 
-    private static Boolean disable(Boolean bool) {
+    private static Boolean disable(Boolean bool)
+    {
         return false;
     }
 
-    private static Boolean enable(Boolean bool) {
+    private static Boolean enable(Boolean bool)
+    {
         return true;
     }
 
-    private static Class<? extends TGeometry>[] filterOf(Class<? extends TGeometry>... geometryOfFilters) {
+    private static Class<? extends TGeometry>[] filterOf(Class<? extends TGeometry>... geometryOfFilters)
+    {
         return geometryOfFilters;
     }
 
-    private static Class<? extends TGeometry>[] propertyOf(Class<? extends TGeometry>... geometryOfProperty) {
+    private static Class<? extends TGeometry>[] propertyOf(Class<? extends TGeometry>... geometryOfProperty)
+    {
         return geometryOfProperty;
     }
 
-    private static class ConfigurationEntry {
+    private static class ConfigurationEntry
+    {
         private SpatialConfiguration.INDEXING_METHOD method;
         private Boolean orderBy;
         private List<Class<? extends TGeometry>> supportedPropertyGeometries = new LinkedList<>();
         private List<Class<? extends TGeometry>> supportedFilterGeometries = new LinkedList<>();
 
-        public ConfigurationEntry(Class<? extends TGeometry>[] geometriesOfProperty, Class<? extends TGeometry>[] geometriesOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method) {
+        public ConfigurationEntry(Class<? extends TGeometry>[] geometriesOfProperty, Class<? extends TGeometry>[] geometriesOfFilter, Boolean orderBy, SpatialConfiguration.INDEXING_METHOD method)
+        {
             this.supportedPropertyGeometries = Arrays.asList(geometriesOfProperty);
             this.supportedFilterGeometries = Arrays.asList(geometriesOfFilter);
             this.orderBy = orderBy;
             this.method = method;
         }
 
-        public boolean isSupported(Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, Boolean orderBy, Boolean verifyOrderBy) {
-            System.out.println("geometryOfProperty " + geometryOfProperty);
-            System.out.println("geometryOfFilter " + geometryOfFilter);
-            System.out.println("OrderBy " + orderBy);
+        public boolean isSupported(Class<? extends TGeometry> geometryOfProperty, Class<? extends TGeometry> geometryOfFilter, Boolean orderBy, Boolean verifyOrderBy)
+        {
 
-            if (supportsProperty(geometryOfProperty) && supportsFilter(geometryOfFilter)) {
-                if (verifyOrderBy) {
+            if (supportsProperty(geometryOfProperty) && supportsFilter(geometryOfFilter))
+            {
+                if (verifyOrderBy)
+                {
                     if (this.orderBy && orderBy) return true;
                     if (this.orderBy && !orderBy) return true;
                     if (!this.orderBy && !orderBy) return true;
@@ -135,7 +142,8 @@ public class SpatialFunctionsSupportMatrix {
             return false;
         }
 
-        private boolean supportsProperty(Class<? extends TGeometry> geometryOfProperty) {
+        private boolean supportsProperty(Class<? extends TGeometry> geometryOfProperty)
+        {
             if (supportedPropertyGeometries.contains(TGeometry.class))
                 return true;
             else if (supportedPropertyGeometries.contains(geometryOfProperty))
@@ -144,7 +152,8 @@ public class SpatialFunctionsSupportMatrix {
                 return false;
         }
 
-        private boolean supportsFilter(Class<? extends TGeometry> geometryOfFilter) {
+        private boolean supportsFilter(Class<? extends TGeometry> geometryOfFilter)
+        {
             if (supportedFilterGeometries.contains(TGeometry.class))
                 return true;
             else if (supportedFilterGeometries.contains(geometryOfFilter))

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/convert/ST_GeometryFromText.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/convert/ST_GeometryFromText.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/convert/ST_GeometryFromText.java
index bd8fe6c..4ec3adc 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/convert/ST_GeometryFromText.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/convert/ST_GeometryFromText.java
@@ -23,20 +23,24 @@ import org.qi4j.spi.query.EntityFinderException;
 
 import java.util.Map;
 
-import static org.qi4j.library.spatial.conversions.TConversions.Convert;
+import static org.qi4j.library.spatial.formats.conversions.TConversions.Convert;
 
 
-public class ST_GeometryFromText extends AbstractElasticSearchSpatialFunction implements ConvertFinderSupport.ConvertSpecification {
-    public void processSpecification(FilterBuilder filterBuilder, SpatialConvertSpecification<?> spec, Map<String, Object> variables) throws EntityFinderException {
+public class ST_GeometryFromText extends AbstractElasticSearchSpatialFunction implements ConvertFinderSupport.ConvertSpecification
+{
+    public void processSpecification(FilterBuilder filterBuilder, SpatialConvertSpecification<?> spec, Map<String, Object> variables) throws EntityFinderException
+    {
         try
         {
             spec.setGeometry(Convert(module).from(spec.property()).toTGeometry());
-        } catch (Exception _ex) {
+        } catch (Exception _ex)
+        {
             throw new EntityFinderException(_ex);
         }
     }
 
-    public ConvertFinderSupport.ConvertSpecification support(Module module, ElasticSearchSupport support) {
+    public ConvertFinderSupport.ConvertSpecification support(Module module, ElasticSearchSupport support)
+    {
         this.module = module;
         this.support = support;
         return this;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Disjoint.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Disjoint.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Disjoint.java
index b0164b4..5603bb5 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Disjoint.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Disjoint.java
@@ -33,11 +33,13 @@ import java.util.Map;
 import static org.elasticsearch.index.query.FilterBuilders.notFilter;
 
 
-public class ST_Disjoint extends AbstractElasticSearchSpatialFunction implements PredicateFinderSupport.PredicateSpecification {
+public class ST_Disjoint extends AbstractElasticSearchSpatialFunction implements PredicateFinderSupport.PredicateSpecification
+{
     public void processSpecification(FilterBuilder filterBuilder,
                                      SpatialPredicatesSpecification<?> spec,
                                      Map<String, Object> variables)
-            throws EntityFinderException {
+            throws EntityFinderException
+    {
         TGeometry geomOfFilterProperty = resolveGeometry(filterBuilder, spec, module);
 
         if (!isValid(spec))
@@ -50,8 +52,10 @@ public class ST_Disjoint extends AbstractElasticSearchSpatialFunction implements
             throw new EntityFinderException(spec.getClass() + " expression unsupported by ElasticSearch. Pls specify a supported expression.");
 
 
-        if (isPropertyOfType(TPoint.class, spec.property()) && isMappedAsGeoShape(spec.property())) {
-            if (geomOfFilterProperty instanceof TPolygon) {
+        if (isPropertyOfType(TPoint.class, spec.property()) && isMappedAsGeoShape(spec.property()))
+        {
+            if (geomOfFilterProperty instanceof TPolygon)
+            {
 
                 if (((ST_DisjointSpecification) spec).getDistance() > 0)
                     throw new EntityFinderException("Invalid ST_Disjoint expression. A " + TPolygon.class.getSimpleName() + " can " +
@@ -61,24 +65,28 @@ public class ST_Disjoint extends AbstractElasticSearchSpatialFunction implements
 
                 GeoPolygonFilterBuilder geoPolygonFilterBuilder = FilterBuilders.geoPolygonFilter(spec.property().toString());
 
-                for (int i = 0; i < polygonFilter.shell().get().getNumPoints(); i++) {
+                for (int i = 0; i < polygonFilter.shell().get().getNumPoints(); i++)
+                {
                     TPoint point = polygonFilter.shell().get().getPointN(i);
                     geoPolygonFilterBuilder.addPoint(point.x(), point.y());
                 }
                 addFilter(notFilter(geoPolygonFilterBuilder), filterBuilder);
-            } else if (geomOfFilterProperty instanceof TPoint && ((ST_DisjointSpecification) spec).getDistance() > 0) {
+            } else if (geomOfFilterProperty instanceof TPoint && ((ST_DisjointSpecification) spec).getDistance() > 0)
+            {
                 double radiusInMeters = convertDistanceToMeters(((ST_DisjointSpecification) spec).getDistance(), ((ST_DisjointSpecification) spec).getUnit());
                 TPolygon polygonizedCircleFilter = polygonizeCircle((TPoint) verifyProjection(geomOfFilterProperty), radiusInMeters);
                 addFilter(createShapeFilter(spec.property().toString(), polygonizedCircleFilter, ShapeRelation.DISJOINT), filterBuilder);
             }
-        } else {
+        } else
+        {
             addFilter(createShapeFilter(spec.property().toString(), geomOfFilterProperty, ShapeRelation.DISJOINT), filterBuilder);
         }
 
 
     }
 
-    public PredicateFinderSupport.PredicateSpecification support(Module module, ElasticSearchSupport support) {
+    public PredicateFinderSupport.PredicateSpecification support(Module module, ElasticSearchSupport support)
+    {
         this.module = module;
         this.support = support;
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Intersects.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Intersects.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Intersects.java
index a85c66e..a13f1b4 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Intersects.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/functions/predicates/ST_Intersects.java
@@ -34,16 +34,16 @@ import java.util.Map;
 import static org.elasticsearch.index.query.FilterBuilders.notFilter;
 
 
-public class ST_Intersects extends AbstractElasticSearchSpatialFunction implements PredicateFinderSupport.PredicateSpecification {
+public class ST_Intersects extends AbstractElasticSearchSpatialFunction implements PredicateFinderSupport.PredicateSpecification
+{
 
     public void processSpecification(FilterBuilder filterBuilder,
                                      SpatialPredicatesSpecification<?> spec,
                                      Map<String, Object> variables)
-            throws EntityFinderException {
+            throws EntityFinderException
+    {
         TGeometry geomOfFilterProperty = resolveGeometry(filterBuilder, spec, module);
 
-        System.out.println("Spec " + spec);
-
         if (!isValid(spec))
             throw new EntityFinderException(spec.getClass() + " expression invalid.");
 
@@ -54,8 +54,10 @@ public class ST_Intersects extends AbstractElasticSearchSpatialFunction implemen
             throw new EntityFinderException(spec.getClass() + " expression unsupported by ElasticSearch. Pls specify a supported expression.");
 
 
-        if (isPropertyOfType(TPoint.class, spec.property())) {
-            if (geomOfFilterProperty instanceof TPolygon) {
+        if (isPropertyOfType(TPoint.class, spec.property()))
+        {
+            if (geomOfFilterProperty instanceof TPolygon)
+            {
 
                 if (((ST_DisjointSpecification) spec).getDistance() > 0)
                     throw new EntityFinderException("Invalid ST_Disjoint expression. A " + TPolygon.class.getSimpleName() + " can " +
@@ -65,24 +67,28 @@ public class ST_Intersects extends AbstractElasticSearchSpatialFunction implemen
 
                 GeoPolygonFilterBuilder geoPolygonFilterBuilder = FilterBuilders.geoPolygonFilter(spec.property().toString());
 
-                for (int i = 0; i < polygonFilter.shell().get().getNumPoints(); i++) {
+                for (int i = 0; i < polygonFilter.shell().get().getNumPoints(); i++)
+                {
                     TPoint point = polygonFilter.shell().get().getPointN(i);
                     geoPolygonFilterBuilder.addPoint(point.x(), point.y());
                 }
                 addFilter(notFilter(geoPolygonFilterBuilder), filterBuilder);
-            } else if (geomOfFilterProperty instanceof TPoint && ((ST_IntersectsSpecification) spec).getDistance() > 0) {
+            } else if (geomOfFilterProperty instanceof TPoint && ((ST_IntersectsSpecification) spec).getDistance() > 0)
+            {
                 double radiusInMeters = convertDistanceToMeters(((ST_IntersectsSpecification) spec).getDistance(), ((ST_IntersectsSpecification) spec).getUnit());
                 TPolygon polygonizedCircleFilter = polygonizeCircle((TPoint) verifyProjection(geomOfFilterProperty), radiusInMeters);
                 addFilter(createShapeFilter(spec.property().toString(), polygonizedCircleFilter, ShapeRelation.INTERSECTS), filterBuilder);
             }
-        } else {
+        } else
+        {
 
             addFilter(createShapeFilter(spec.property().toString(), geomOfFilterProperty, ShapeRelation.INTERSECTS), filterBuilder);
         }
 
     }
 
-    public PredicateFinderSupport.PredicateSpecification support(Module module, ElasticSearchSupport support) {
+    public PredicateFinderSupport.PredicateSpecification support(Module module, ElasticSearchSupport support)
+    {
         this.module = module;
         this.support = support;
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoPointBuilder.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoPointBuilder.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoPointBuilder.java
index c653283..54d6104 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoPointBuilder.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoPointBuilder.java
@@ -25,13 +25,15 @@ import java.util.StringTokenizer;
 /**
  * Created by jj on 19.12.14.
  */
-public class GeoPointBuilder extends AbstractBuilder {
+public class GeoPointBuilder extends AbstractBuilder
+{
 
-    public GeoPointBuilder(ElasticSearchSupport support) {
+    public GeoPointBuilder(ElasticSearchSupport support)
+    {
         this.support = support;
     }
 
-    private  String createGeoPointMapping(String field) throws IOException
+    private String createGeoPointMapping(String field) throws IOException
     {
         XContentBuilder qi4jRootType = XContentFactory.jsonBuilder().startObject().startObject(support.entitiesType());
         StringTokenizer t1 = new StringTokenizer(field, ".");
@@ -41,10 +43,10 @@ public class GeoPointBuilder extends AbstractBuilder {
             propertyLevel1 = t1.nextToken();
             qi4jRootType.startObject("properties").startObject(propertyLevel1);
         }
-                qi4jRootType
-                        .field("type", "geo_point") // geo_point
-                        .field("precision", SpatialConfiguration.getIndexerPrecision(support.spatialConfiguration()))
-                        .field("lat_lon", true);
+        qi4jRootType
+                .field("type", "geo_point")
+                .field("precision", SpatialConfiguration.getIndexerPrecision(support.spatialConfiguration()))
+                .field("lat_lon", true);
 
         StringTokenizer t2 = new StringTokenizer(field, ".");
         while (t2.hasMoreTokens())
@@ -57,13 +59,14 @@ public class GeoPointBuilder extends AbstractBuilder {
         return qi4jRootType.string();
     }
 
-    public boolean create(String field) {
-        try {
+    public boolean create(String field)
+    {
+        try
+        {
             return put(field, createGeoPointMapping(field));
-        } catch (Exception _ex) {
-            _ex.printStackTrace();
+        } catch (IOException _ex)
+        {
+            throw new RuntimeException(_ex);
         }
-        return false;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoShapeBuilder.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoShapeBuilder.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoShapeBuilder.java
index fb739fb..2bcc0d7 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoShapeBuilder.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/GeoShapeBuilder.java
@@ -25,13 +25,16 @@ import java.util.StringTokenizer;
 /**
  * Created by jj on 19.12.14.
  */
-public class GeoShapeBuilder extends AbstractBuilder {
+public class GeoShapeBuilder extends AbstractBuilder
+{
 
-    public GeoShapeBuilder(ElasticSearchSupport support) {
+    public GeoShapeBuilder(ElasticSearchSupport support)
+    {
         this.support = support;
     }
 
-    private  String createESGeoShapeMapping(String property) throws IOException {
+    private String createESGeoShapeMapping(String property) throws IOException
+    {
 
         XContentBuilder qi4jRootType = XContentFactory.jsonBuilder().startObject().startObject(support.entitiesType());
 
@@ -60,13 +63,15 @@ public class GeoShapeBuilder extends AbstractBuilder {
         return qi4jRootType.string();
     }
 
-    public boolean create(String field) {
-        try {
+    public boolean create(String field)
+    {
+        try
+        {
             return put(field, createESGeoShapeMapping(field));
-        } catch (Exception _ex) {
-            _ex.printStackTrace();
+        } catch (IOException _ex)
+        {
+             throw new RuntimeException(_ex);
         }
-        return false;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/MappingQueryBuilder.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/MappingQueryBuilder.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/MappingQueryBuilder.java
index d70ae1c..bd4ee08 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/MappingQueryBuilder.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/MappingQueryBuilder.java
@@ -19,9 +19,11 @@ import org.qi4j.index.elasticsearch.ElasticSearchSupport;
 /**
  * Created by jj on 19.12.14.
  */
-public class MappingQueryBuilder extends AbstractBuilder {
+public class MappingQueryBuilder extends AbstractBuilder
+{
 
-    public MappingQueryBuilder(ElasticSearchSupport support) {
+    public MappingQueryBuilder(ElasticSearchSupport support)
+    {
         this.support = support;
     }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/SpatialMappingFactory.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/SpatialMappingFactory.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/SpatialMappingFactory.java
index 1d13756..e6b68cb 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/SpatialMappingFactory.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/builders/SpatialMappingFactory.java
@@ -19,17 +19,21 @@ import org.qi4j.index.elasticsearch.ElasticSearchSupport;
 /**
  * Created by jj on 19.12.14.
  */
-public class SpatialMappingFactory {
+public class SpatialMappingFactory
+{
 
-    public static GeoPointBuilder GeoPointMapping(ElasticSearchSupport support) {
+    public static GeoPointBuilder GeoPointMapping(ElasticSearchSupport support)
+    {
         return new GeoPointBuilder(support);
     }
 
-    public static GeoShapeBuilder GeoShapeMapping(ElasticSearchSupport support) {
+    public static GeoShapeBuilder GeoShapeMapping(ElasticSearchSupport support)
+    {
         return new GeoShapeBuilder(support);
     }
 
-    public static MappingQueryBuilder MappingQuery(ElasticSearchSupport support) {
+    public static MappingQueryBuilder MappingQuery(ElasticSearchSupport support)
+    {
         return new MappingQueryBuilder(support);
     }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/cache/MappingsCache.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/cache/MappingsCache.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/cache/MappingsCache.java
index 3128092..3829019 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/cache/MappingsCache.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/extensions/spatial/mappings/cache/MappingsCache.java
@@ -23,10 +23,9 @@ import java.util.concurrent.TimeUnit;
 
 import static org.qi4j.index.elasticsearch.extensions.spatial.mappings.builders.SpatialMappingFactory.MappingQuery;
 
-/**
- * Created by jj on 19.12.14.
- */
-public class MappingsCache {
+
+public class MappingsCache
+{
 
     private static final int TTL_SECONDS = 1 * 60; // <- JJ TODO make it configurable
     private static final int CONCURENCY_LEVEL = 50;
@@ -42,54 +41,59 @@ public class MappingsCache {
                         .expireAfterAccess(TTL_SECONDS, TimeUnit.SECONDS)
                         .concurrencyLevel(CONCURENCY_LEVEL) // valid ?
                         .build(
-                                new CacheLoader<String, String>() {
-                                    public String load(String key) {
-                                        if (valid()) {
+                                new CacheLoader<String, String>()
+                                {
+                                    public String load(String key)
+                                    {
+                                        if (valid())
+                                        {
                                             return reloadStrategy(key);
                                         } else
                                             return "";
                                     }
                                 }
                         );
-
     }
 
 
-    public MappingsCache(ElasticSearchSupport support) {
+    public MappingsCache(ElasticSearchSupport support)
+    {
         this.support = support;
     }
 
-    private String reloadStrategy(String key) {
-
-        System.out.println("Reload Cache for " + key);
-
+    private String reloadStrategy(String key)
+    {
         String result = MappingQuery(support).get(key);
-        System.out.println("Reload Result " + result);
         return (result == null || result.length() == 0) ? "" : result;
     }
 
-    private boolean valid() {
+    private boolean valid()
+    {
         return (support != null) && (support.index() != null) && (support.entitiesType() != null) ? true : false;
     }
 
 
-    public boolean exists(String key) {
+    public boolean exists(String key)
+    {
         return (ES_MAPPINGS_CACHE.getUnchecked(key) == null) || ES_MAPPINGS_CACHE.getUnchecked(key).length() == 0 ? false : true;
     }
 
-    public String get(String key) {
+    public String get(String key)
+    {
         return ES_MAPPINGS_CACHE.getUnchecked(key);
     }
 
 
-    public void put(String key, String mappings) {
-        System.out.println("Cache PUT key " + key + " mappings " + mappings);
+    public void put(String key, String mappings)
+    {
         if (mappings != null)
             ES_MAPPINGS_CACHE.put(key, mappings);
     }
 
-    public boolean putIfNotExist(String key, String mappings) {
-        if (!exists(key)) {
+    public boolean putIfNotExist(String key, String mappings)
+    {
+        if (!exists(key))
+        {
             put(key, mappings);
             return false;
         } else

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/ElasticSearchSpatialClusterQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/ElasticSearchSpatialClusterQueryTest.java b/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/ElasticSearchSpatialClusterQueryTest.java
deleted file mode 100644
index 154ffd1..0000000
--- a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/ElasticSearchSpatialClusterQueryTest.java
+++ /dev/null
@@ -1,484 +0,0 @@
-package org.qi4j.index.elasticsearch;
-
-import org.joda.time.LocalDateTime;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.qi4j.api.common.Visibility;
-import org.qi4j.api.entity.EntityBuilder;
-import org.qi4j.api.geometry.TPoint;
-import org.qi4j.api.geometry.TPolygon;
-import org.qi4j.api.geometry.TUnit;
-import org.qi4j.api.geometry.internal.Coordinate;
-import org.qi4j.api.geometry.internal.TLinearRing;
-import org.qi4j.api.injection.scope.Service;
-import org.qi4j.api.query.Query;
-import org.qi4j.api.query.QueryBuilder;
-import org.qi4j.api.unitofwork.UnitOfWork;
-import org.qi4j.api.value.ValueBuilder;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.index.elasticsearch.assembly.ESClusterIndexQueryAssembler;
-import org.qi4j.library.fileconfig.FileConfigurationOverride;
-import org.qi4j.library.fileconfig.FileConfigurationService;
-import org.qi4j.test.EntityTestAssembler;
-import org.qi4j.test.indexing.AbstractSpatialQueryTest;
-import org.qi4j.test.indexing.NameableAssert;
-import org.qi4j.test.indexing.model.City;
-import org.qi4j.test.indexing.model.Female;
-import org.qi4j.test.indexing.model.Person;
-import org.qi4j.test.indexing.model.entities.FemaleEntity;
-import org.qi4j.test.util.DelTreeAfter;
-
-import java.io.File;
-import java.util.Iterator;
-
-import static org.joda.time.DateTimeZone.UTC;
-import static org.junit.Assert.assertNotNull;
-import static org.qi4j.api.query.QueryExpressions.*;
-import static org.qi4j.api.query.QueryExpressions.lt;
-import static org.qi4j.api.query.grammar.extensions.spatial.SpatialQueryExpressions.ST_Disjoint;
-import static org.qi4j.api.query.grammar.extensions.spatial.SpatialQueryExpressions.ST_Within;
-import static org.qi4j.api.query.grammar.extensions.spatial.SpatialQueryExpressions.ST_GeometryFromText;
-import static org.qi4j.test.indexing.NameableAssert.verifyUnorderedResults;
-import static org.qi4j.test.util.Assume.assumeNoIbmJdk;
-import static org.qi4j.api.geometry.TGeometryFactory.*;
-
-/**
- * Created by jakes on 2/8/14.
- */
-public class ElasticSearchSpatialClusterQueryTest
-        extends AbstractSpatialQueryTest {
-    private static final File DATA_DIR = new File("build/tmp/es-money-query-test");
-    @Rule
-    public final DelTreeAfter delTreeAfter = new DelTreeAfter(DATA_DIR);
-
-    @BeforeClass
-    public static void beforeClass_IBMJDK() {
-        assumeNoIbmJdk();
-    }
-
-    @Override
-    public void assemble(ModuleAssembly module)
-            throws AssemblyException {
-        super.assemble(module);
-
-        // Config module
-        ModuleAssembly config = module.layer().module("config");
-        new EntityTestAssembler().assemble(config);
-
-        // Index/Query
-        new ESClusterIndexQueryAssembler().
-                withConfig(config, Visibility.layer).
-                assemble(module);
-        ElasticSearchConfiguration esConfig = config.forMixin(ElasticSearchConfiguration.class).declareDefaults();
-        esConfig.indexNonAggregatedAssociations().set(Boolean.TRUE);
-
-        // FileConfig
-        FileConfigurationOverride override = new FileConfigurationOverride().
-                withData(new File(DATA_DIR, "qi4j-data")).
-                withLog(new File(DATA_DIR, "qi4j-logs")).
-                withTemporary(new File(DATA_DIR, "qi4j-temp"));
-        module.services(FileConfigurationService.class).
-                setMetaInfo(override);
-    }
-
-    @Override
-    public void setUp()
-            throws Exception {
-        super.setUp();
-
-        try (UnitOfWork unitOfWork = module.newUnitOfWork()) {
-
-            // Kuala Lumpur
-
-            // Latitude    3.139003
-            // Longitude 101.686854
-
-            ValueBuilder<TPolygon> builder = module.newValueBuilder(TPolygon.class);
-
-            TPolygon area = builder.prototype().of
-                    (
-                            // shell
-                            (TLinearRing)module.newValueBuilder(TLinearRing.class).prototype().of
-                                    (
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.56797785892715).y(10.62652587890625),
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.5835615987737).y(10.748062133789062),
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.533230478523684).y(10.78857421875),
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.484185749507716).y(10.72265625),
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.49310663031507).y(10.578460693359375),
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.5416968611641).y(10.583267211914062),
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.555507284155276).y(10.605239868164062),
-                                            module.newValueBuilder(TPoint.class).prototype().x(49.56797785892715).y(10.62652587890625)
-                                    )
-                    );
-
-
-            System.out.println("Area " + area);
-
-            City Emskirchen;
-            {
-                EntityBuilder<City> cityBuilder = unitOfWork.newEntityBuilder(City.class);
-                Emskirchen = cityBuilder.instance();
-                Emskirchen.name().set("Emskirchen");
-                Emskirchen.country().set("Germany");
-                Emskirchen.county().set("Bavaria");
-                Emskirchen.location().set(TPoint(module).x (49.550881).y(10.712809).geometry());
-                Emskirchen = cityBuilder.newInstance();
-                // NameableAssert.trace( kualaLumpur );
-                Emskirchen.area().set(area);
-
-            }
-
-
-            Female annDoe;
-            {
-                EntityBuilder<FemaleEntity> femaleBuilder = unitOfWork.newEntityBuilder(FemaleEntity.class, "anndoe2");
-                annDoe = femaleBuilder.instance();
-                annDoe.name().set("Ann Doe 2");
-                annDoe.title().set(Person.Title.MRS);
-                annDoe.placeOfBirth().set(Emskirchen);
-                annDoe.favoritePlaces().put("Emskirchen", Emskirchen);
-                annDoe.yearOfBirth().set(1975);
-                annDoe.password().set("passwordOfAnnDoe");
-
-                annDoe = femaleBuilder.newInstance();
-                NameableAssert.trace(annDoe);
-            }
-
-            unitOfWork.complete();
-
-        } catch (Exception _ex) {
-            _ex.printStackTrace();
-        }
-
-    }
-
-    @Test
-    public void whenQueryUseConversion() throws Exception {
-        // lat, long
-        ST_GeometryFromText("POINT(49.550881 10.712809)");
-
-
-        QueryBuilder<City> qb = this.module.newQueryBuilder(City.class);
-
-        Query<City> query = unitOfWork.newQuery(
-                qb
-                        .where(
-                                ST_Within
-                                        (
-                                                templateFor(City.class).location(),
-                                                ST_GeometryFromText("POINT(49.550881 10.712809)"),
-                                                100,
-                                                TUnit.METER
-                                        )
-                        ));
-
-
-        // System.out.println( "*** script01: " + query );
-        query.find();
-
-
-        System.out.println("Found Cities " + query.count());
-
-
-//        QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
-//        Person personTemplate = templateFor( Person.class );
-//        City placeOfBirth = personTemplate.placeOfBirth().get();
-//        Query<Person> query = unitOfWork.newQuery( qb.where( eq( placeOfBirth.name(), "Kuala Lumpur" ) ) );
-//        System.out.println( "*** script04: " + query );
-//       //  verifyUnorderedResults( query, "Joe Doe", "Ann Doe" );
-    }
-
-    @Test
-    public void whenQueryUsePolygon() throws Exception {
-
-
-        QueryBuilder<City> qb = this.module.newQueryBuilder(City.class);
-
-        Query<City> query = unitOfWork.newQuery(
-                qb
-                        .where(
-                                ST_Within
-                                        (
-                                                templateFor(City.class).area(),
-
-                                                ST_GeometryFromText(
-                                                        "POLYGON((" +
-                                                                "49.56797785892715 10.62652587890625," +
-                                                                "49.5835615987737 10.748062133789062," +
-                                                                "49.533230478523684 10.78857421875," +
-                                                                "49.484185749507716 10.72265625," +
-                                                                "49.49310663031507 10.578460693359375," +
-                                                                "49.5416968611641 10.583267211914062," +
-                                                                "49.555507284155276 10.605239868164062," +
-                                                                "49.56797785892715 10.62652587890625))")
-                                        )
-                        ));
-
-
-        // System.out.println( "*** script01: " + query );
-        query.find();
-
-
-        System.out.println("Found Cities " + query.count());
-
-
-//        QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
-//        Person personTemplate = templateFor( Person.class );
-//        City placeOfBirth = personTemplate.placeOfBirth().get();
-//        Query<Person> query = unitOfWork.newQuery( qb.where( eq( placeOfBirth.name(), "Kuala Lumpur" ) ) );
-//        System.out.println( "*** script04: " + query );
-//       //  verifyUnorderedResults( query, "Joe Doe", "Ann Doe" );
-    }
-
-
-    @Test
-    public void whenQueryUsePolygonDSL() throws Exception {
-
-
-        QueryBuilder<City> qb = this.module.newQueryBuilder(City.class);
-
-        Query<City> query = unitOfWork.newQuery(
-                qb
-                        .where(
-                                ST_Within
-                                        (
-                                                templateFor(City.class).area(),
-
-                                                TPolygon(module)
-                                                        .shell
-                                                                (
-                                                                        new double[][]
-                                                                                {
-                                                                                        {49.56797785892715, 10.62652587890625},
-                                                                                        {49.5835615987737, 10.748062133789062},
-                                                                                        {49.533230478523684, 10.78857421875},
-                                                                                        {49.484185749507716, 10.72265625},
-                                                                                        {49.49310663031507, 10.578460693359375},
-                                                                                        {49.5416968611641, 10.583267211914062},
-                                                                                        {49.555507284155276, 10.605239868164062},
-                                                                                        {49.56797785892715, 10.62652587890625}
-
-                                                                                }
-                                                                ).geometry()
-                                        )
-                        ));
-
-
-        query.find();
-
-        System.out.println("Found Cities " + query.count());
-    }
-
-
-    @Test
-    public void directQuery() {
-
-        ValueBuilder<TPolygon> tPolygonShapeBuilder = module.newValueBuilder(TPolygon.class);
-        TPolygon tPolygonShape = tPolygonShapeBuilder.prototype().of
-                (
-                        // shell
-                        (TLinearRing)module.newValueBuilder(TLinearRing.class).prototype().of
-                                (
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.56797785892715),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.62652587890625)   //y
-                                                )
-                                        ,
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.5835615987737),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.748062133789062)   //y
-                                                )
-                                        ,
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.533230478523684),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.78857421875)   //y
-                                                )
-                                        ,
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.484185749507716),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.72265625)   //y
-                                                )
-                                        ,
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.49310663031507),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.578460693359375)   //y
-                                                )
-
-                                        ,
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.5416968611641),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.583267211914062)   //y
-                                                )
-                                        ,
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.555507284155276),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.605239868164062)   //y
-                                                )
-                                        ,
-                                        module.newValueBuilder(TPoint.class).prototype().of
-                                                (
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(49.56797785892715),  //x
-                                                        module.newValueBuilder(Coordinate.class).prototype().of(10.62652587890625)   //y
-                                                )
-
-
-                                        // ,
-                                        // no holes
-                                        // null
-                                ));
-
-
-        QueryBuilder<City> qb = this.module.newQueryBuilder(City.class);
-/**
- Query<City> query = unitOfWork.newQuery(
- qb
-
- .where(
- ST_Within(templateFor(City.class).location(),
-
- tPolygonShape
- )));
-
-
- // System.out.println( "*** script01: " + query );
- query.find();
-
-
-
- System.out.println("Found Cities 123 " + query.count());
- */
-
-    }
-
-
-    @Test
-    public void whenQueryUseConversion2() throws Exception {
-        // lat, long
-        ST_GeometryFromText("POINT(49.550881 10.712809)");
-
-
-        QueryBuilder<City> qb = this.module.newQueryBuilder(City.class);
-
-        Query<City> query = unitOfWork.newQuery(
-                qb
-                        .where(
-                                ST_Within
-                                        (
-                                                templateFor(City.class).location(),
-                                                ST_GeometryFromText("POINT(49.550881 10.712809)"),
-                                                100,
-                                                TUnit.METER
-                                        )
-                        ));
-
-
-        query.find();
-
-        System.out.println("Found Cities " + query.count());
-
-        Iterator<City> cities = query.iterator();
-
-        while (cities.hasNext()) {
-            System.out.println("Cities " + cities.next().name());
-        }
-
-    }
-
-
-    @Test
-    public void whenSpatialQueryWithNot() throws Exception {
-
-        QueryBuilder<City> qb = this.module.newQueryBuilder(City.class);
-
-        Query<City> query = unitOfWork.newQuery(
-                qb
-                        .where(not(
-                                        ST_Within
-                                                (
-                                                        templateFor(City.class).location(),
-                                                        ST_GeometryFromText("POINT(49.550881 10.712809)"),
-                                                        100,
-                                                        TUnit.METER
-                                                )
-                                )
-                        ));
-
-
-        query.find();
-
-        System.out.println("Found Cities " + query.count());
-
-        Iterator<City> cities = query.iterator();
-
-        while (cities.hasNext()) {
-            System.out.println("Cities " + cities.next().name());
-        }
-    }
-
-
-    @Test
-    public void whenST_DisjoinThen() throws Exception {
-
-        QueryBuilder<City> qb = this.module.newQueryBuilder(City.class);
-
-        Query<City> query = unitOfWork.newQuery(
-                qb
-                        .where(
-                                ST_Disjoint(
-                                        (
-                                                templateFor(City.class).area()),
-                                        ST_GeometryFromText("POINT(49.550881 10.712809)"),
-                                        100
-                                )
-
-                        ));
-
-
-        query.find();
-
-        System.out.println("Found Cities " + query.count());
-
-        Iterator<City> cities = query.iterator();
-
-        while (cities.hasNext()) {
-            System.out.println("Cities " + cities.next().name());
-        }
-    }
-
-    /**
-     * QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
-     * Person person = templateFor( Person.class );
-     * Query<Person> query = unitOfWork.newQuery( qb.where( ge( person.yearOfBirth(), 1973 ) ) );
-     * System.out.println( "*** script06: " + query );
-     * verifyUnorderedResults( query, "Joe Doe", "Ann Doe" );
-     *
-     * @throws Exception
-     */
-
-    //                         .where(ge(templateFor(City.class).location(), "123")));
-
-
-
-    @Test
-    public void script43_LocalDateTime() {
-        QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
-        Person person = templateFor(Person.class);
-        Query<Person> query = unitOfWork.newQuery(qb.where(
-                and(gt(person.localDateTimeValue(), new LocalDateTime("2005-03-04T13:24:35", UTC)),
-                        lt(person.localDateTimeValue(), new LocalDateTime("2015-03-04T13:24:35", UTC)))));
-        System.out.println("*** script43_LocalDateTime: " + query);
-
-        verifyUnorderedResults(query, "Jack Doe");
-    }
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialBench.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialBench.java b/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialBench.java
deleted file mode 100644
index 67a9623..0000000
--- a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialBench.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.qi4j.index.elasticsearch.extension.spatial;
-
-import com.spatial4j.core.distance.DistanceUtils;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.qi4j.api.common.Visibility;
-import org.qi4j.api.entity.EntityBuilder;
-import org.qi4j.api.geometry.TPoint;
-import org.qi4j.api.unitofwork.UnitOfWork;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.riak.RiakHttpMapEntityStoreAssembler;
-import org.qi4j.index.elasticsearch.ElasticSearchConfiguration;
-import org.qi4j.index.elasticsearch.assembly.ESClusterIndexQueryAssembler;
-import org.qi4j.index.elasticsearch.extension.spatial.utils.RandomPoint;
-import org.qi4j.index.elasticsearch.extensions.spatial.configuration.SpatialConfiguration;
-import org.qi4j.library.fileconfig.FileConfigurationOverride;
-import org.qi4j.library.fileconfig.FileConfigurationService;
-import org.qi4j.library.spatial.assembly.TGeometryAssembler;
-import org.qi4j.test.EntityTestAssembler;
-import org.qi4j.test.indexing.AbstractAnyQueryTest;
-import org.qi4j.test.indexing.AbstractSpatialRegressionTest;
-import org.qi4j.test.util.DelTreeAfter;
-import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
-
-import java.io.File;
-
-import static org.qi4j.api.geometry.TGeometryFactory.*;
-import static org.qi4j.test.util.Assume.*;
-
-/**
- * Created by jj on 21.12.14.
- */
-public class ElasticSearchSpatialBench
-        extends AbstractSpatialRegressionTest
-{
-    private static final File DATA_DIR = new File( "build/tmp/es-spatial-query-test" );
-    @Rule
-    public final DelTreeAfter delTreeAfter = new DelTreeAfter( DATA_DIR );
-
-    @BeforeClass
-    public static void beforeClass_IBMJDK()
-    {
-        assumeNoIbmJdk();
-    }
-
-
-    @Override
-    public void assemble( ModuleAssembly module )
-            throws AssemblyException
-    {
-        super.assemble( module );
-
-        // Geometry support
-        new TGeometryAssembler().assemble(module);
-
-        // Config module
-        ModuleAssembly config = module.layer().module( "config" );
-        new EntityTestAssembler().assemble( config );
-
-        config.values(SpatialConfiguration.Configuration.class,
-                SpatialConfiguration.FinderConfiguration.class,
-                SpatialConfiguration.IndexerConfiguration.class,
-                SpatialConfiguration.IndexingMethod.class,
-                SpatialConfiguration.ProjectionSupport.class).
-                visibleIn(Visibility.application);
-
-        // Index/Query
-        new ESClusterIndexQueryAssembler().
-                withConfig(config, Visibility.layer).
-                identifiedBy("ElasticSearchBenchmark").
-                assemble(module);
-        ElasticSearchConfiguration esConfig = config.forMixin(ElasticSearchConfiguration.class).declareDefaults();
-        esConfig.indexNonAggregatedAssociations().set(Boolean.TRUE);
-
-        // FileConfig
-        FileConfigurationOverride override = new FileConfigurationOverride().
-                withData(new File(DATA_DIR, "qi4j-data")).
-                withLog(new File(DATA_DIR, "qi4j-logs")).
-                withTemporary(new File(DATA_DIR, "qi4j-temp"));
-        module.services(FileConfigurationService.class).
-                setMetaInfo(override);
-
-        // In-Memory Entity Store
-        // new EntityTestAssembler().assemble( module );
-
-
-        /** RIAK */
-        ModuleAssembly configRiak = module.layer().module( "configRiak" );
-        new EntityTestAssembler().assemble( configRiak );
-        new OrgJsonValueSerializationAssembler().assemble( module );
-        // START SNIPPET: assembly
-        new RiakHttpMapEntityStoreAssembler().identifiedBy("RIAKBenchmark").withConfig(configRiak, Visibility.layer ).assemble( module );
-        /** +++ */
-    }
-
-    // @Test
-    public void test() throws Exception
-    {
-
-        try (UnitOfWork unitOfWork = module.newUnitOfWork())
-        {
-            unitOfWork.complete();
-
-        }
-        // double[] xy = nextSpherePt2D();
-
-        // System.out.println("spherical " + xy[0] + " " + xy[1] );
-        long start = System.currentTimeMillis();
-
-        module.newUnitOfWork();
-        for (int i = 0; i < 10000; i++) {
-
-            double[] xy = nextSpherePt2D();
-            System.out.println("Degrees " + DistanceUtils.toDegrees(xy[0]) + "," + DistanceUtils.toDegrees(xy[1]));
-
-            TPoint(module).lat(xy[0]).lon(xy[1]).geometry();
-        }
-        module.currentUnitOfWork().complete();
-
-        long end = System.currentTimeMillis();
-
-        System.out.println("Duration  " + (end - start));
-    }
-
-    @Test
-    public void test1() throws Exception
-    {
-
-        try (UnitOfWork unitOfWork = module.newUnitOfWork())
-        {
-            unitOfWork.complete();
-
-        }
-        // double[] xy = nextSpherePt2D();
-
-        // System.out.println("spherical " + xy[0] + " " + xy[1] );
-        long start = System.currentTimeMillis();
-        for (int j = 0; j < 10000; j++)
-        {
-            System.out.println("--> " + j);
-            UnitOfWork unitOfWork = module.newUnitOfWork();
-
-
-            for (int i = 0; i < 1000; i++) {
-                double[] xy = nextSpherePt2D();
-                //System.out.println("Degrees " + DistanceUtils.toDegrees(xy[0]) + "," + DistanceUtils.toDegrees(xy[1]));
-
-                TPoint point = TPoint(module).lat(DistanceUtils.toDegrees(xy[0])).lon(DistanceUtils.toDegrees(xy[1])).geometry();
-                EntityBuilder<SpatialAEntity> pointBuilder = unitOfWork.newEntityBuilder(SpatialAEntity.class);
-                pointBuilder.instance().point().set(point);
-                pointBuilder.newInstance();
-            }
-
-            unitOfWork.complete();
-        }
-        long end = System.currentTimeMillis();
-
-        System.out.println("Duration  " + (end - start));
-    }
-
-     static long seed = 1;
-    static RandomPoint randomPoint = new RandomPoint();
-
-    public double[] nextSpherePt2D()
-    {
-        return randomPoint.nextSpherePt(2);
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialQueryTestUsingUsingDefaults.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialQueryTestUsingUsingDefaults.java b/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialQueryTestUsingUsingDefaults.java
index 1904139..b96f845 100644
--- a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialQueryTestUsingUsingDefaults.java
+++ b/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/ElasticSearchSpatialQueryTestUsingUsingDefaults.java
@@ -36,9 +36,7 @@ import java.io.File;
 
 import static org.qi4j.test.util.Assume.assumeNoIbmJdk;
 
-/**
- * Created by jj on 21.12.14.
- */
+
 public class ElasticSearchSpatialQueryTestUsingUsingDefaults
         extends AbstractSpatialRegressionTest
 {
@@ -62,8 +60,6 @@ public class ElasticSearchSpatialQueryTestUsingUsingDefaults
         // Geometry support
         new TGeometryAssembler().assemble(module);
 
-
-
         // Config module
         ModuleAssembly config = module.layer().module( "config" );
         new EntityTestAssembler().assemble( config );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/utils/RandomPoint.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/utils/RandomPoint.java b/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/utils/RandomPoint.java
deleted file mode 100644
index 1835104..0000000
--- a/extensions/indexing-elasticsearch/src/test/java/org/qi4j/index/elasticsearch/extension/spatial/utils/RandomPoint.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.qi4j.index.elasticsearch.extension.spatial.utils;
-
-import java.io.Serializable;
-
-
-public class RandomPoint extends RandomUtils implements Serializable {
-
-    /**
-     * 	auto generated
-     */
-    private static final long serialVersionUID = -1772453101010620003L;
-
-    /**
-     *  for the case d = 2
-     */
-    private static final double twopi = 8*Math.atan(1);
-
-
-
-    /**
-     * Generates the next pseudorandom double value vector, with
-     * equal probability of picking any vector on the unit
-     * d-dimensional hypersphere.
-     *
-     * The algorithm is based on the work of Marsaglia in
-     * Marsaglia, G. "Choosing a Point from the Surface of a Sphere."
-     * Ann. Math. Stat. 43, 645-646, 1972
-     *
-     * and Muller in
-     * Muller, M. E. "A Note on a Type for Generating Points Uniformly on N-Dimensional Spheres."
-     * Comm. Assoc. Comput. Mach. 2, 19-20, Apr. 1959.
-     *
-     * See also:
-     * Weisstein, Eric W. "Sphere Point Picking."
-     * From MathWorld--A Wolfram Web Resource.
-     * http://mathworld.wolfram.com/SpherePointPicking.html and
-     * http://mathworld.wolfram.com/HyperspherePointPicking.html
-     *
-     * @return the next pseudorandom vector on the d-dimensional unit hypersphere
-     */
-
-    public RandomPoint(){
-        this(System.currentTimeMillis());
-    }
-
-    public RandomPoint(long seed){
-        setSeed(seed);
-    }
-
-    public double[] nextSpherePt(int d){
-
-        double ret[] = new double[d];
-
-        if (d == 1){
-            ret[0] = -1;
-            if(nextDouble() > 0.5)
-                ret[0] = 1;
-        }
-        else if (d == 2){
-            ret = new double[2];
-            double theta = nextDouble()*twopi;
-            ret[0] = Math.cos(theta);
-            ret[1] = Math.sin(theta);
-            return ret;
-        }
-        else if (d == 3){
-            double x, y, z;
-            ret = new double[3];
-            x = 2*(nextDouble() - 0.5);
-            y = 2*(nextDouble() - 0.5);
-            while ((x*x + y*y) >= 1)
-                y = 2*(nextDouble() - 0.5);
-            z = 1 - 2*(x*x+y*y);
-            ret[0] = x;
-            ret[1] = y;
-            ret[2] = z;
-        }
-        else{
-            ret = new double[d];
-            double nrm = 0;
-            for (int jj = 0 ; jj < d ; jj ++){
-                ret[jj] = nextGaussian();
-                nrm += ret[jj]+ret[jj];
-            }
-            nrm = Math.sqrt(nrm);
-            for (int jj = 0 ; jj < d ; jj ++){
-                ret[jj] = ret[jj] / nrm;
-            }
-        }
-
-        return ret;
-    }
-
-    /**
-     * Generates the next pseudorandom double value vector, with
-     * equal probability of picking any vector on the  d-dimensional
-     * hypersphere of radius RR.
-     *
-     * The algorithm is based on the work of Marsaglia in
-     * Marsaglia, G. "Choosing a Point from the Surface of a Sphere."
-     * Ann. Math. Stat. 43, 645-646, 1972
-     *
-     * and Muller in
-     * Muller, M. E. "A Note on a Type for Generating Points Uniformly on N-Dimensional Spheres."
-     * Comm. Assoc. Comput. Mach. 2, 19-20, Apr. 1959.
-     *
-     * See also:
-     * Weisstein, Eric W. "Sphere Point Picking."
-     * From MathWorld--A Wolfram Web Resource.
-     * http://mathworld.wolfram.com/SpherePointPicking.html and
-     * http://mathworld.wolfram.com/HyperspherePointPicking.html
-     *
-     * @return the next pseudorandom vector on the d-dimensional hypersphere of radius RR.
-     */
-
-    public double[] nextSpherePt(int d, double RR){
-
-        double ret[] = new double[d];
-
-        if (d == 1){
-            ret[0] = -1*RR;
-            if(nextDouble() > 0.5)
-                ret[0] = RR;
-        }
-        else if (d == 2){
-            ret = new double[2];
-            double theta = nextDouble()*twopi;
-            ret[0] = RR*Math.cos(theta);
-            ret[1] = RR*Math.sin(theta);
-            return ret;
-        }
-        else{
-            ret = new double[d];
-            double nrm = 0;
-            for (int jj = 0 ; jj < d ; jj ++){
-                ret[jj] = nextGaussian();
-                nrm += ret[jj]*ret[jj];
-            }
-            nrm = Math.sqrt(nrm);
-            for (int jj = 0 ; jj < d ; jj ++){
-                ret[jj] = RR*(ret[jj] / nrm);
-            }
-        }
-
-        return ret;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/extensions/indexing-elasticsearch/src/test/resources/RIAKBenchmark.properties
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/test/resources/RIAKBenchmark.properties b/extensions/indexing-elasticsearch/src/test/resources/RIAKBenchmark.properties
deleted file mode 100644
index 94d160c..0000000
--- a/extensions/indexing-elasticsearch/src/test/resources/RIAKBenchmark.properties
+++ /dev/null
@@ -1 +0,0 @@
-urls=http://localhost:8098/riak
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/libraries/spatial/build.gradle
----------------------------------------------------------------------
diff --git a/libraries/spatial/build.gradle b/libraries/spatial/build.gradle
index 9d6bed3..49bd90a 100644
--- a/libraries/spatial/build.gradle
+++ b/libraries/spatial/build.gradle
@@ -1,14 +1,14 @@
 description = "Qi4j Spatial Library contains various spatial related services and tools."
 
-jar { manifest { name = "Qi4j Library - Spatial" }}
+jar { manifest { name = "Qi4j Library - Spatial" } }
 
 dependencies {
-  compile(project(":org.qi4j.core:org.qi4j.core.bootstrap"))
-  compile libraries.geojackson
-  compile libraries.ctsVersion
+    compile(project(":org.qi4j.core:org.qi4j.core.bootstrap"))
+    compile libraries.geojackson
+    compile libraries.ctsVersion
 
-  testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport"))
+    testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport"))
 
-  testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime"))
-  testRuntime(libraries.logback)
+    testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime"))
+    testRuntime(libraries.logback)
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/libraries/spatial/dev-status.xml
----------------------------------------------------------------------
diff --git a/libraries/spatial/dev-status.xml b/libraries/spatial/dev-status.xml
index 91abd4f..93a3d5a 100644
--- a/libraries/spatial/dev-status.xml
+++ b/libraries/spatial/dev-status.xml
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://www.qi4j.org/schemas/2008/dev-status/1"
         xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1
         http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd">
-  <status>
-    <!--none,early,beta,stable,mature-->
-    <codebase>none</codebase>
+    <status>
+        <!--none,early,beta,stable,mature-->
+        <codebase>none</codebase>
 
-    <!-- none, brief, good, complete -->
-    <documentation>none</documentation>
+        <!-- none, brief, good, complete -->
+        <documentation>none</documentation>
 
-    <!-- none, some, good, complete -->
-    <unittests>none</unittests>
-  </status>
-  <licenses>
-    <license>ALv2</license>
-  </licenses>
+        <!-- none, some, good, complete -->
+        <unittests>none</unittests>
+    </status>
+    <licenses>
+        <license>ALv2</license>
+    </licenses>
 </module>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/GeoJsonFromConverter.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/GeoJsonFromConverter.java b/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/GeoJsonFromConverter.java
deleted file mode 100644
index a75f9e1..0000000
--- a/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/GeoJsonFromConverter.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright 2014 Jiri Jetmar.
- *
- * Licensed  under the  Apache License,  Version 2.0  (the "License");
- * you may not use  this file  except in  compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed  under the  License is distributed on an "AS IS" BASIS,
- * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.qi4j.library.spatial.conversions.from;
-
-import org.geojson.*;
-import org.qi4j.api.geometry.*;
-import org.qi4j.api.geometry.internal.TGeometry;
-import org.qi4j.api.geometry.internal.TLinearRing;
-import org.qi4j.api.structure.Module;
-
-import java.util.List;
-
-import static org.qi4j.api.geometry.TGeometryFactory.*;
-import static org.qi4j.api.geometry.TGeometryFactory.TLinearRing;
-
-
-public class GeoJsonFromConverter {
-
-    private Module module;
-
-    public GeoJsonFromConverter(Module module)
-    {
-        this.module = module;
-    }
-
-    public TGeometry convert(GeoJsonObject geojson)
-
-    {
-        return transform(geojson);
-    }
-
-    private TGeometry transform(GeoJsonObject geojson)
-    {
-        if (geojson instanceof Point)
-        {
-            return createTPoint((Point) geojson);
-        }
-        else if ( (geojson instanceof MultiPoint) && !(geojson instanceof LineString) )
-        {
-            return createTMultiPoint((MultiPoint)geojson);
-        }
-        else if (geojson instanceof LineString)
-        {
-            return createTLineString((LineString)geojson);
-        }
-        else if (geojson instanceof MultiLineString)
-        {
-            return createTMultiLineString((MultiLineString)geojson);
-        }
-        else if (geojson instanceof Polygon)
-        {
-            return createTPolygon((Polygon) geojson);
-        }
-        else if (geojson instanceof MultiPolygon)
-        {
-            return createTMultiPolygon((MultiPolygon) geojson);
-        }
-        else if (geojson instanceof Feature)
-        {
-            return createTFeature((Feature)geojson);
-        }
-        else if (geojson instanceof FeatureCollection)
-        {
-            return createTFeatureCollection((FeatureCollection)geojson);
-        }
-        else throw new RuntimeException("Unknown GeoJSON type - " + geojson);
-    }
-
-
-    private TGeometry createTPoint(Point point)
-    {
-        return TPoint(module)
-                .x(point.getCoordinates().getLatitude())
-                .y(point.getCoordinates().getLongitude())
-                .z(point.getCoordinates().getAltitude())
-                .geometry();
-    }
-    private TGeometry createTMultiPoint(MultiPoint multiPoint)
-    {
-        TMultiPoint tMultiPoint = TMultiPoint(module).geometry();
-        for (LngLatAlt xyz : multiPoint.getCoordinates() )
-        {
-            tMultiPoint.of
-                    (
-                            TPoint(module)
-                                    .x(xyz.getLatitude())
-                                    .y(xyz.getLongitude())
-                                    .z(xyz.getAltitude())
-                                    .geometry()
-                    );
-        }
-        return tMultiPoint;
-    }
-
-    private TGeometry createTLineString(LineString lineString)
-    {
-        TLineString tLineString = TLineString(module).of().geometry();
-
-        for (LngLatAlt xyz : lineString.getCoordinates() ) {
-            tLineString.of(
-                    TPoint(module)
-                            .x(xyz.getLatitude())
-                            .y(xyz.getLongitude())
-                            .z(xyz.getAltitude())
-                            .geometry()
-            );
-        }
-        return tLineString;
-    }
-
-    private TGeometry createTMultiLineString(MultiLineString multiLineString)
-    {
-        TMultiLineString tMultiLineString = TMultiLineString(module).of().geometry();
-        for (List<LngLatAlt> coordinates : multiLineString. getCoordinates())
-        {
-            tMultiLineString.of(getLine(coordinates));
-        }
-        return tMultiLineString;
-    }
-
-    private TGeometry createTPolygon(Polygon polygon)
-    {
-        TPolygon tPolygon;
-        TLinearRing ring = getRing((polygon).getExteriorRing());
-        if (!ring.isValid())
-            throw  new RuntimeException("Polygon shell not valid");
-        else
-            tPolygon = TPolygon(module).shell(ring).geometry();
-        for (int i = 0; i < (polygon).getInteriorRings().size(); i++)
-        {
-            tPolygon.withHoles(getRing((polygon).getInteriorRings().get(i)));
-        }
-        return tPolygon;
-    }
-
-    private TGeometry createTMultiPolygon(MultiPolygon multiPolygon)
-    {
-        TMultiPolygon tMultiPolygon = TMultiPolygon(module).of().geometry();
-        for (List<List<LngLatAlt>> polygons : multiPolygon.getCoordinates() )
-        {
-            for (List<LngLatAlt> polygon : polygons  )
-            {
-                tMultiPolygon.of(TPolygon(module).shell(getRing(polygon)).geometry());
-            }
-        }
-        return tMultiPolygon;
-    }
-
-    private TGeometry createTFeature(Feature feature)
-    {
-        return TFeature(module).of(new GeoJsonFromConverter(module).transform(feature.getGeometry())).geometry();
-    }
-
-    private TGeometry createTFeatureCollection(FeatureCollection featurecollection)
-    {
-        TFeatureCollection tFeatureCollection = TFeatureCollection(module).of().geometry();
-        for (Feature feature : featurecollection.getFeatures())
-        {
-            tFeatureCollection.of((TFeature)createTFeature(feature));
-        }
-        return tFeatureCollection;
-    }
-
-    private TLineString getLine(List<LngLatAlt> coordinates)
-    {
-        TLineString tLineString = TLineString(module).of().geometry();
-        for (LngLatAlt xyz :coordinates )
-        {
-            tLineString.yx(xyz.getLatitude(), xyz.getLongitude());
-        }
-        return tLineString;
-    }
-    private TLinearRing getRing(List<LngLatAlt> coordinates)
-    {
-
-        TLinearRing tLinearRing = TLinearRing(module).of().geometry();
-        for (LngLatAlt xyz :coordinates ) {
-            tLinearRing.yx(xyz.getLatitude(), xyz.getLongitude());
-        }
-
-        if (!tLinearRing.isClosed())
-        {
-            tLinearRing.of(tLinearRing.getStartPoint()); // hack here - we are closing the ring, of not closed.
-        }
-
-        return tLinearRing;
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/684bb9eb/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/TGeometryFromConverter.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/TGeometryFromConverter.java b/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/TGeometryFromConverter.java
deleted file mode 100644
index 2c66b42..0000000
--- a/libraries/spatial/src/main/java/org/qi4j/library/spatial/conversions/from/TGeometryFromConverter.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2014 Jiri Jetmar.
- *
- * Licensed  under the  Apache License,  Version 2.0  (the "License");
- * you may not use  this file  except in  compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed  under the  License is distributed on an "AS IS" BASIS,
- * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.qi4j.library.spatial.conversions.from;
-
-import org.qi4j.api.geometry.internal.TGeometry;
-import org.qi4j.api.structure.Module;
-
-
-public class TGeometryFromConverter {
-
-    private Module module;
-
-    public TGeometryFromConverter(Module module)
-    {
-        this.module = module;
-    }
-
-    public TGeometry convert(TGeometry tGeometry)
-    {
-        return tGeometry;
-    }
-}


Mime
View raw message