Search in sources :

Example 6 with Produces

use of org.polymap.core.data.pipeline.Produces in project polymap4-core by Polymap4.

the class FeatureRenameProcessor method featuresSizeRequest.

@Produces(GetFeaturesSizeRequest.class)
public void featuresSizeRequest(GetFeaturesSizeRequest request, ProcessorContext context) throws Exception {
    Query transformed = transformQuery(request.getQuery(), context);
    context.sendRequest(new GetFeaturesSizeRequest(transformed));
}
Also used : GetFeaturesSizeRequest(org.polymap.core.data.feature.GetFeaturesSizeRequest) Query(org.geotools.data.Query) Produces(org.polymap.core.data.pipeline.Produces)

Example 7 with Produces

use of org.polymap.core.data.pipeline.Produces in project polymap4-core by Polymap4.

the class FeatureRenameProcessor method boundsRequest.

@Produces(GetBoundsRequest.class)
public void boundsRequest(GetBoundsRequest request, ProcessorContext context) throws Exception {
    Query transformed = transformQuery(request.query.get(), context);
    context.sendRequest(new GetBoundsRequest(transformed));
}
Also used : Query(org.geotools.data.Query) GetBoundsRequest(org.polymap.core.data.feature.GetBoundsRequest) Produces(org.polymap.core.data.pipeline.Produces)

Example 8 with Produces

use of org.polymap.core.data.pipeline.Produces in project polymap4-core by Polymap4.

the class FeatureRenameProcessor method featureTypeResponse.

@Produces(GetFeatureTypeResponse.class)
public void featureTypeResponse(GetFeatureTypeResponse response, ProcessorContext context) throws Exception {
    assert this.srcSchema == null;
    this.srcSchema = response.getFeatureType();
    SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
    builder.init((SimpleFeatureType) srcSchema);
    builder.setName(name);
    schema = builder.buildFeatureType();
    context.sendResponse(new GetFeatureTypeResponse(schema));
}
Also used : SimpleFeatureTypeBuilder(org.geotools.feature.simple.SimpleFeatureTypeBuilder) GetFeatureTypeResponse(org.polymap.core.data.feature.GetFeatureTypeResponse) Produces(org.polymap.core.data.pipeline.Produces)

Example 9 with Produces

use of org.polymap.core.data.pipeline.Produces in project polymap4-core by Polymap4.

the class ImageDecodeProcessor method decodeImageResponse.

/**
 * Collect enoded image chunks.
 */
@Produces(ImageResponse.class)
@Consumes(EncodedImageResponse.class)
public void decodeImageResponse(EncodedImageResponse response, ProcessorContext context) throws Exception {
    ByteArrayOutputStream data = (ByteArrayOutputStream) context.get("data");
    if (data == null) {
        data = new ByteArrayOutputStream(64 * 1024);
        context.put("data", data);
    }
    data.write(response.getChunk(), 0, response.getChunkSize());
}
Also used : ByteArrayOutputStream(java.io.ByteArrayOutputStream) Produces(org.polymap.core.data.pipeline.Produces) Consumes(org.polymap.core.data.pipeline.Consumes)

Example 10 with Produces

use of org.polymap.core.data.pipeline.Produces in project polymap4-core by Polymap4.

the class FeatureRenameProcessor method featureTypeRequest.

@Produces(GetFeatureTypeRequest.class)
public void featureTypeRequest(GetFeatureTypeRequest request, ProcessorContext context) throws Exception {
    // and init target schema on response
    if (schema == null) {
        context.sendRequest(request);
    } else {
        context.sendResponse(new GetFeatureTypeResponse(schema));
        context.sendResponse(ProcessorResponse.EOP);
    }
}
Also used : GetFeatureTypeResponse(org.polymap.core.data.feature.GetFeatureTypeResponse) Produces(org.polymap.core.data.pipeline.Produces)

Aggregations

Produces (org.polymap.core.data.pipeline.Produces)11 Consumes (org.polymap.core.data.pipeline.Consumes)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 Query (org.geotools.data.Query)3 BufferedImage (java.awt.image.BufferedImage)2 GetFeatureTypeResponse (org.polymap.core.data.feature.GetFeatureTypeResponse)2 Image (java.awt.Image)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ArrayList (java.util.ArrayList)1 SimpleFeatureBuilder (org.geotools.feature.simple.SimpleFeatureBuilder)1 SimpleFeatureTypeBuilder (org.geotools.feature.simple.SimpleFeatureTypeBuilder)1 Feature (org.opengis.feature.Feature)1 Property (org.opengis.feature.Property)1 PropertyDescriptor (org.opengis.feature.type.PropertyDescriptor)1 GetBoundsRequest (org.polymap.core.data.feature.GetBoundsRequest)1 GetFeaturesRequest (org.polymap.core.data.feature.GetFeaturesRequest)1 GetFeaturesResponse (org.polymap.core.data.feature.GetFeaturesResponse)1 GetFeaturesSizeRequest (org.polymap.core.data.feature.GetFeaturesSizeRequest)1 EncodedImageResponse (org.polymap.core.data.image.EncodedImageResponse)1 ImageEncodeProcessor (org.polymap.core.data.image.ImageEncodeProcessor)1