Package org.openstreetmap.osmosis.pgsnapshot.common

Source Code of org.openstreetmap.osmosis.pgsnapshot.common.PolygonBuilder

// This software is released into the Public Domain.  See copying.txt for details.
package org.openstreetmap.osmosis.pgsnapshot.common;

import org.postgis.LinearRing;
import org.postgis.Point;
import org.postgis.Polygon;


/**
* Builds PostGIS Polygon objects based on a series of points.
*
* @author Brett Henderson
*/
public class PolygonBuilder {
  /**
   * Creates a PostGIS Polygon object corresponding to the provided Point
   * list.
   *
   * @param points
   *            The points to build a polygon from.
   * @return The Polygon object.
   */
  public Polygon createPolygon(Point[] points) {
    Polygon result;
   
    result = new Polygon(new LinearRing[] {new LinearRing(points)});
    result.srid = 4326;
   
    return result;
  }
}
TOP

Related Classes of org.openstreetmap.osmosis.pgsnapshot.common.PolygonBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.