Fixes Coordinates parsing

This commit is contained in:
Fabio Sinibaldi 2022-05-06 16:39:44 +02:00
parent 21cc19c713
commit c44a8c851f
3 changed files with 64 additions and 2 deletions

View File

@ -36,7 +36,7 @@ public class BBOXByCoordinatePaths extends BBOXEvaluator{
@Override
public GCubeSDILayer.BBOX evaluate(Document profileConfiguration, UseCaseDescriptor useCaseDescriptor, JSONPathWrapper documentNavigator) {
List coordsConfig=profileConfiguration.get("coordinatesPaths",List.class);
List coordsConfig=profileConfiguration.get("coordinatesPath",List.class);
GCubeSDILayer.BBOX toSet = null;
for(Object coordsObj:coordsConfig){
log.debug("UseCaseDescriptor {} : Evaluating coords {} ", useCaseDescriptor.getId(),coordsObj);

View File

@ -33,7 +33,12 @@ public class IndexerTest extends BasicPluginTest {
@Test
public void testIndexRequest() throws PluginExecutionException, JsonProcessingException {
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
Project doc= TestDocuments.documentMap.get("profiledConcessioniExample.json");
UseCaseDescriptor ucd=TestProfiles.profiles.get("sdi-tests");
Project doc= TestDocuments.documentMap.get("dummy.json");
doc.setProfileID(ucd.getId());
doc.getTheDocument().put("coordX",10d);
doc.getTheDocument().put("coordY",11d);
IndexDocumentRequest request=new IndexDocumentRequest(TestProfiles.profiles.get(doc.getProfileID()),
getCurrentUser(),getTestContext(),doc);
@ -55,6 +60,10 @@ public class IndexerTest extends BasicPluginTest {
}
@Test
public void getIndex() throws ConfigurationException, JsonProcessingException {
assumeTrue(GCubeTest.isTestInfrastructureEnabled());

View File

@ -0,0 +1,53 @@
{
"_id" : "sdi-tests",
"_version" : "1.0.0",
"_name" : "SDI Tests",
"_description" : "Used for tests on sdi plugins",
"_creationInfo": {
"_user" : {
"_username": "fabio.sinibaldi"
}
},
"_schema" :{ "title" : {"_min" : 1},
"section" : { "_max" : 1, "_min" : 1,
"_children" : [
{"fileset" :{"_type" : "RegisteredFileSet", "_min": 1}},
{"title" : {"_min" : 1}}
]
}
},
"_dataAccessPolicies" : [
{"_policy" : {"_read" : "any", "_write" : "any"}, "_roles":[]}
],
"_handlers" : [
{
"_id" : "DEFAULT-SINGLE-STEP",
"_type" : "LifecycleManagement",
"_configuration" : {
"step_access" : [
{"STEP" : "PUBLISH", "roles" :[]}
]
}
},
{
"_id": "SDI-Indexer-Plugin",
"_type": "Indexer",
"_configuration": {
"coordinatesPath" :[{"x" : "$._theDocument.coordX", "y" : "$._theDocument.coordY"}],
"explicitFieldMapping": [],
"additionalLayers": [
{
"source": {
"url": "..."
},
"toSetTitle": ""
}
]
}
}
]
}