Created
May 25, 2017 08:48
-
-
Save russellhoff/54af4abd5862baf86afceb8407ff85e4 to your computer and use it in GitHub Desktop.
A simple factory to create Points and Linestrings with 4326 srid.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.vividsolutions.jts.geom.Coordinate; | |
import com.vividsolutions.jts.geom.GeometryFactory; | |
import com.vividsolutions.jts.geom.LineString; | |
import com.vividsolutions.jts.geom.Point; | |
import com.vividsolutions.jts.geom.PrecisionModel; | |
public class GeometriesFactory { | |
private static GeometryFactory factory4326 = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING), 4326); | |
public static Point createPoint(Double pLatitude, Double pLongitude){ | |
return factory4326.createPoint(new Coordinate(pLongitude, pLatitude)); | |
} | |
public static LineString createLineString(Coordinate[] pCoordsArray){ | |
return factory4326.createLineString(pCoordsArray); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment