use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class MultiMergerTest method geoJsonTwoFeatures.
/**
* Test if two GeoJSON features can be merged to a feature collection
* @param context the Vert.x test context
*/
@Test
public void geoJsonTwoFeatures(TestContext context) {
String strChunk1 = "{\"type\":\"Feature\"}";
String strChunk2 = "{\"type\":\"Feature\",\"properties\":{}}";
Buffer chunk1 = Buffer.buffer(strChunk1);
Buffer chunk2 = Buffer.buffer(strChunk2);
GeoJsonChunkMeta cm1 = new GeoJsonChunkMeta("Feature", "features", 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\":[" + strChunk1 + "," + strChunk2 + "]}");
}
use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class GeoJsonMergerTest method twoFeatures.
/**
* Test if two features can be merged to a feature collection
* @param context the Vert.x test context
*/
@Test
public void twoFeatures(TestContext context) {
String strChunk1 = "{\"type\":\"Feature\"}";
String strChunk2 = "{\"type\":\"Feature\",\"properties\":{}}";
Buffer chunk1 = Buffer.buffer(strChunk1);
Buffer chunk2 = Buffer.buffer(strChunk2);
GeoJsonChunkMeta cm1 = new GeoJsonChunkMeta("Feature", "features", 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\":[" + strChunk1 + "," + strChunk2 + "]}");
}
use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class GeoJsonMergerTest method oneGeometry.
/**
* Test if one geometry is rendered directly
* @param context the Vert.x test context
*/
@Test
public void oneGeometry(TestContext context) {
String strChunk1 = "{\"type\":\"Polygon\"}";
Buffer chunk1 = Buffer.buffer(strChunk1);
GeoJsonChunkMeta cm1 = new GeoJsonChunkMeta("Polygon", "geometries", 0, chunk1.length());
doMerge(context, Observable.just(chunk1), Observable.just(cm1), strChunk1);
}
use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class GeoJsonMergerTest method threeFeatures.
/**
* Test if three features can be merged to a feature collection
* @param context the Vert.x test context
*/
@Test
public void threeFeatures(TestContext context) {
String strChunk1 = "{\"type\":\"Feature\"}";
String strChunk2 = "{\"type\":\"Feature\",\"properties\":{}}";
String strChunk3 = "{\"type\":\"Feature\",\"geometry\":[]}";
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("Feature", "features", 0, chunk3.length());
doMerge(context, Observable.just(chunk1, chunk2, chunk3), Observable.just(cm1, cm2, cm3), "{\"type\":\"FeatureCollection\",\"features\":[" + strChunk1 + "," + strChunk2 + "," + strChunk3 + "]}");
}
use of io.georocket.storage.GeoJsonChunkMeta in project georocket by georocket.
the class GeoJsonMergerTest method threeGeometries.
/**
* Test if three geometries can be merged to a geometry collection
* @param context the Vert.x test context
*/
@Test
public void threeGeometries(TestContext context) {
String strChunk1 = "{\"type\":\"Polygon\"}";
String strChunk2 = "{\"type\":\"Point\"}";
String strChunk3 = "{\"type\":\"MultiPoint\"}";
Buffer chunk1 = Buffer.buffer(strChunk1);
Buffer chunk2 = Buffer.buffer(strChunk2);
Buffer chunk3 = Buffer.buffer(strChunk3);
GeoJsonChunkMeta cm1 = new GeoJsonChunkMeta("Polygon", "geometries", 0, chunk1.length());
GeoJsonChunkMeta cm2 = new GeoJsonChunkMeta("Point", "geometries", 0, chunk2.length());
GeoJsonChunkMeta cm3 = new GeoJsonChunkMeta("MultiPoint", "geometries", 0, chunk3.length());
doMerge(context, Observable.just(chunk1, chunk2, chunk3), Observable.just(cm1, cm2, cm3), "{\"type\":\"GeometryCollection\",\"geometries\":[" + strChunk1 + "," + strChunk2 + "," + strChunk3 + "]}");
}
Aggregations