diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java index 4d3ea03cf1e09bf32b7a4685a4f38588533d0b50..0fff49372910c1223b589dbea32ed8a19cb85bd8 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java @@ -32,6 +32,7 @@ import org.opengroup.osdu.indexer.schema.converter.tags.VirtualProperties; import org.opengroup.osdu.indexer.schema.converter.tags.VirtualProperty; import org.opengroup.osdu.indexer.util.VirtualPropertyUtil; import org.opengroup.osdu.indexer.util.geo.decimator.DecimatedResult; +import org.opengroup.osdu.indexer.util.geo.decimator.GeoShapeDecimationSetting; import org.opengroup.osdu.indexer.util.geo.decimator.GeoShapeDecimator; import org.springframework.stereotype.Component; @@ -57,6 +58,8 @@ public class StorageIndexerPayloadMapper { private IVirtualPropertiesSchemaCache virtualPropertiesSchemaCache; @Inject private GeoShapeDecimator decimator; + @Inject + private GeoShapeDecimationSetting decimationSetting; public Map<String, Object> mapDataPayload(IndexSchema storageSchema, Map<String, Object> storageRecordData, String recordId) { @@ -238,7 +241,7 @@ public class StorageIndexerPayloadMapper { } // No VirtualProperties.DefaultLocation.Wgs84Coordinates defined, use the default geo-shape property - if (originalGeoShapeProperty == null) + if (originalGeoShapeProperty == null && decimationSetting.isDecimationEnabled()) originalGeoShapeProperty = getDefaultGeoShapeProperty(dataCollectorMap); if(originalGeoShapeProperty != null) { try { diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java index fbacb7c17120d7e85e5718ea7797421e3bcf58f9..b3bfb87f6dfaf3e03546bc0c7d718bf3b5383011 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java @@ -20,10 +20,7 @@ import org.opengroup.osdu.indexer.service.mock.PartitionFactoryMock; import org.opengroup.osdu.indexer.service.mock.PartitionProviderMock; import org.opengroup.osdu.indexer.service.mock.ServiceAccountJwtClientMock; import org.opengroup.osdu.indexer.service.mock.VirtualPropertiesSchemaCacheMock; -import org.opengroup.osdu.indexer.util.geo.decimator.DecimationSettingCache; -import org.opengroup.osdu.indexer.util.geo.decimator.DouglasPeuckerReducer; -import org.opengroup.osdu.indexer.util.geo.decimator.GeoShapeDecimator; -import org.opengroup.osdu.indexer.util.geo.decimator.GeometryDecimator; +import org.opengroup.osdu.indexer.util.geo.decimator.*; import org.opengroup.osdu.indexer.util.parser.BooleanParser; import org.opengroup.osdu.indexer.util.parser.DateTimeParser; import org.opengroup.osdu.indexer.util.parser.GeoShapeParser; @@ -47,7 +44,7 @@ import static org.junit.Assert.*; @SpringBootTest(classes = {StorageIndexerPayloadMapper.class, AttributeParsingServiceImpl.class, NumberParser.class, BooleanParser.class, DateTimeParser.class, GeoShapeParser.class, DouglasPeuckerReducer.class, GeoShapeDecimator.class, GeometryDecimator.class, GeometryConversionService.class, DecimationSettingCache.class, - DpsHeaders.class, JobStatus.class, SchemaConverterPropertiesConfig.class, JaxRsDpsLog.class, + GeoShapeDecimationSetting.class, DpsHeaders.class, JobStatus.class, SchemaConverterPropertiesConfig.class, JaxRsDpsLog.class, PartitionFactoryMock.class, PartitionProviderMock.class, ServiceAccountJwtClientMock.class, VirtualPropertiesSchemaCacheMock.class, }) public class StorageIndexerPayloadMapperTest {