From 05f1aa650fccbc0ab6e774e44c5a5c88c0f7df9f Mon Sep 17 00:00:00 2001 From: ZMai <zmai@slb.com> Date: Wed, 15 Feb 2023 13:36:35 -0600 Subject: [PATCH] Rollback change --- .../osdu/indexer/service/StorageIndexerPayloadMapper.java | 5 ++++- .../indexer/service/StorageIndexerPayloadMapperTest.java | 7 ++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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 4d3ea03cf..0fff49372 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 fbacb7c17..b3bfb87f6 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 { -- GitLab