1

I am using GeoServer WPS process to process two geometries. I want to expand one of the geometries in the direction of the other. So far I am using the .buffer function but it expands the geometry in all direction.

This is the code I have so far.

public class PossibleTargetPositions extends StaticMethodsProcessFactory<PossibleTargetPositions> {

  public PossibleTargetPositions() {
    super(Text.text("Possible Target Positions"), "gpigf", PossibleTargetPositions.class);
  }

  @DescribeProcess(title = "processTargetPositions", description = "Calculates the new area of possible target positions")
  @DescribeResult(description = "Modified Possible Target Poisitions")
  public static Geometry processTargetPositions(
      @DescribeParameter(name = "current_area", description = "Current possible target positions") Geometry current_area,
      @DescribeParameter(name = "growth_distance", description = "The maximum distance the area should grow by") double growth_distance,      
      @DescribeParameter(name = "growth_segments", description = "The number of segments to use when rounding corners, lower number means less points") int growth_segments) {

      Geometry modified_area = current_area.buffer(growth_distance, growth_segments);

      return modified_area.getFactory().createGeometry(modified_area);
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.