Search in sources :

Example 6 with UTMProjection

use of org.onebusaway.geospatial.services.UTMProjection in project onebusaway-application-modules by camsys.

the class ProjectedPointFactory method reverse.

public static ProjectedPoint reverse(double x, double y, int srid) {
    UTMProjection projection = new UTMProjection(srid);
    XYPoint p = new XYPoint(x, y);
    CoordinatePoint latlon = projection.reverse(p);
    return new ProjectedPoint(latlon.getLat(), latlon.getLon(), x, y, srid);
}
Also used : XYPoint(org.onebusaway.geospatial.model.XYPoint) CoordinatePoint(org.onebusaway.geospatial.model.CoordinatePoint) UTMProjection(org.onebusaway.geospatial.services.UTMProjection) ProjectedPoint(org.onebusaway.transit_data_federation.model.ProjectedPoint)

Example 7 with UTMProjection

use of org.onebusaway.geospatial.services.UTMProjection in project onebusaway-application-modules by camsys.

the class GtfsComputePolylineBoundaryForStopsMain method handleOutputAsText.

private void handleOutputAsText(PrintWriter out, StopToPolygonEntityHandler handler) {
    Geometry geometry = handler.getGeometry();
    UTMProjection proj = handler.getProjection();
    out.println("polygon");
    AtomicInteger index = new AtomicInteger();
    printGeometry(out, geometry, proj, index, true);
    out.println("END");
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) UTMProjection(org.onebusaway.geospatial.services.UTMProjection)

Aggregations

UTMProjection (org.onebusaway.geospatial.services.UTMProjection)7 XYPoint (org.onebusaway.geospatial.model.XYPoint)5 CoordinatePoint (org.onebusaway.geospatial.model.CoordinatePoint)3 Geometry (com.vividsolutions.jts.geom.Geometry)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 ProjectedPoint (org.onebusaway.transit_data_federation.model.ProjectedPoint)2 ShapePoints (org.onebusaway.transit_data_federation.model.ShapePoints)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Test (org.junit.Test)1 Cacheable (org.onebusaway.container.cache.Cacheable)1 PointAndIndex (org.onebusaway.transit_data_federation.impl.shapes.PointAndIndex)1 StopEntryImpl (org.onebusaway.transit_data_federation.impl.transit_graph.StopEntryImpl)1 ShapePointsFactory (org.onebusaway.transit_data_federation.model.ShapePointsFactory)1