All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.umlg.sqlg.gis.GeographyPolygon Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
package org.umlg.sqlg.gis;

import org.postgis.Geometry;
import org.postgis.LinearRing;
import org.postgis.Polygon;

import java.sql.SQLException;

/**
 * Created by pieter on 2015/09/13.
 */
public class GeographyPolygon extends Polygon {

    private Polygon polygon;

    public GeographyPolygon(Polygon polygon) {
        this.polygon = polygon;
        this.srid = polygon.srid;
        this.haveMeasure = polygon.haveMeasure;
        this.dimension = polygon.dimension;
        this.subgeoms = new Geometry[polygon.numGeoms()];
        for (int i = 0 ; i < polygon.numGeoms(); i++) {
            subgeoms[i] = polygon.getSubGeometry(i);
        }
    }

    public GeographyPolygon() {
        this.srid = 4326;
    }

    public GeographyPolygon(LinearRing[] rings) {
        super(rings);
        this.srid = Gis.SRID;
    }

    public GeographyPolygon(String value) throws SQLException {
        super(value);
        this.srid = Gis.SRID;
    }

    public GeographyPolygon(String value, boolean haveM) throws SQLException {
        super(value, haveM);
        this.srid = Gis.SRID;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy