@Override public JsonIndexer createIndexer() { return new GeoJsonGenericAttributeIndexer(); } }
@Override public JsonIndexer createIndexer() { return new GeoJsonBoundingBoxIndexer(); } }
/** * Test if a JSON file containing a Point geometry can be indexed * @param context the current test context * @throws IOException if the JSON file could not be read */ @Test public void point(TestContext context) throws IOException { List<List<Double>> expected = Arrays.asList( Arrays.asList(8.6599, 49.87424), Arrays.asList(8.6599, 49.87424) ); assertIndexed(expected, "point.json", context); }
GeoJsonGenericAttributeIndexer indexer = new GeoJsonGenericAttributeIndexer(); .last() .subscribe(r -> { context.assertEquals(expectedMap, indexer.getResult()); async.complete(); }, err -> {
GeoJsonBoundingBoxIndexer indexer = new GeoJsonBoundingBoxIndexer(); .last() .subscribe(r -> { context.assertEquals(expectedMap, indexer.getResult()); async.complete(); }, err -> {
case JsonEvent.VALUE_FALSE: case JsonEvent.VALUE_NULL: String value = eventValueToString(event); if (currentKey != null && propertiesLevel == level - 1) { put(currentKey, value);
/** * Test if a JSON file containing a Feature can be indexed * @param context the current test context * @throws IOException if the JSON file could not be read */ @Test public void feature(TestContext context) throws IOException { Map<String, Object> expected = ImmutableMap.of( "name", "My Feature", "location", "Moon", "owner", "Elvis", "year", "2016", "solid", "true" ); assertIndexed(expected, "feature.json", context); } }
currentOrdinate = 1; } else if (currentOrdinate == 1) { addToBoundingBox(currentX, d); currentOrdinate = 0;
/** * Test if a JSON file containing a LineString geometry can be indexed * @param context the current test context * @throws IOException if the JSON file could not be read */ @Test public void lineString(TestContext context) throws IOException { List<List<Double>> expected = Arrays.asList( Arrays.asList(8.0, 49.5), Arrays.asList(8.5, 49.0) ); assertIndexed(expected, "linestring.json", context); }
/** * Test if a JSON file containing a Feature with a LineString geometry * can be indexed * @param context the current test context * @throws IOException if the JSON file could not be read */ @Test public void feature(TestContext context) throws IOException { List<List<Double>> expected = Arrays.asList( Arrays.asList(8.0, 49.5), Arrays.asList(8.5, 49.0) ); assertIndexed(expected, "feature.json", context); } }