use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class GeoJsonMergerTest method geometryAndFeature.
/**
* Test if two geometries and a feature can be merged to a feature collection
* @param context the Vert.x test context
*/
@Test
public void geometryAndFeature(TestContext context) {
String strChunk1 = "{\"type\":\"Polygon\"}";
String strChunk2 = "{\"type\":\"Feature\"}";
Buffer chunk1 = Buffer.buffer(strChunk1);
Buffer chunk2 = Buffer.buffer(strChunk2);
GeoJsonChunkMeta cm1 = new GeoJsonChunkMeta("Polygon", "geometries", 0, chunk1.length());
GeoJsonChunkMeta cm2 = new GeoJsonChunkMeta("Feature", "features", 0, chunk2.length());
doMerge(context, Observable.just(chunk1, chunk2), Observable.just(cm1, cm2), "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":" + strChunk1 + "}," + strChunk2 + "]}");
}
use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class GeoJsonMergerTest method featureAndGeometry.
/**
* Test if two geometries and a feature can be merged to a feature collection
* @param context the Vert.x test context
*/
@Test
public void featureAndGeometry(TestContext context) {
String strChunk1 = "{\"type\":\"Feature\"}";
String strChunk2 = "{\"type\":\"Polygon\"}";
Buffer chunk1 = Buffer.buffer(strChunk1);
Buffer chunk2 = Buffer.buffer(strChunk2);
GeoJsonChunkMeta cm1 = new GeoJsonChunkMeta("Feature", "features", 0, chunk1.length());
GeoJsonChunkMeta cm2 = new GeoJsonChunkMeta("Polygon", "geometries", 0, chunk2.length());
doMerge(context, Observable.just(chunk1, chunk2), Observable.just(cm1, cm2), "{\"type\":\"FeatureCollection\",\"features\":[" + strChunk1 + ",{\"type\":\"Feature\",\"geometry\":" + strChunk2 + "}]}");
}
use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class GeoJsonMergerTest method twoFeaturesAndAGeometry.
/**
* Test if two geometries and a feature can be merged to a feature collection
* @param context the Vert.x test context
*/
@Test
public void twoFeaturesAndAGeometry(TestContext context) {
String strChunk1 = "{\"type\":\"Feature\"}";
String strChunk2 = "{\"type\":\"Feature\",\"properties\":{}}";
String strChunk3 = "{\"type\":\"Point\"}";
Buffer chunk1 = Buffer.buffer(strChunk1);
Buffer chunk2 = Buffer.buffer(strChunk2);
Buffer chunk3 = Buffer.buffer(strChunk3);
GeoJsonChunkMeta cm1 = new GeoJsonChunkMeta("Feature", "features", 0, chunk1.length());
GeoJsonChunkMeta cm2 = new GeoJsonChunkMeta("Feature", "features", 0, chunk2.length());
GeoJsonChunkMeta cm3 = new GeoJsonChunkMeta("Point", "geometries", 0, chunk3.length());
doMerge(context, Observable.just(chunk1, chunk2, chunk3), Observable.just(cm1, cm2, cm3), "{\"type\":\"FeatureCollection\",\"features\":[" + strChunk1 + "," + strChunk2 + ",{\"type\":\"Feature\",\"geometry\":" + strChunk3 + "}]}");
}
Aggregations