Search in sources :

Example 21 with XYPoint

use of org.onebusaway.geospatial.model.XYPoint in project onebusaway-application-modules by camsys.

the class ProjectedPointFactory method forward.

public static ProjectedPoint forward(CoordinatePoint latlon, int zone) {
    UTMProjection projection = new UTMProjection(zone);
    XYPoint point = projection.forward(latlon);
    return new ProjectedPoint(latlon.getLat(), latlon.getLon(), point.getX(), point.getY(), zone);
}
Also used : XYPoint(org.onebusaway.geospatial.model.XYPoint) UTMProjection(org.onebusaway.geospatial.services.UTMProjection) ProjectedPoint(org.onebusaway.transit_data_federation.model.ProjectedPoint)

Example 22 with XYPoint

use of org.onebusaway.geospatial.model.XYPoint 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)

Aggregations

XYPoint (org.onebusaway.geospatial.model.XYPoint)22 CoordinatePoint (org.onebusaway.geospatial.model.CoordinatePoint)15 ArrayList (java.util.ArrayList)10 PointAndIndex (org.onebusaway.transit_data_federation.impl.shapes.PointAndIndex)6 Test (org.junit.Test)5 UTMProjection (org.onebusaway.geospatial.services.UTMProjection)5 StopTimeEntryImpl (org.onebusaway.transit_data_federation.impl.transit_graph.StopTimeEntryImpl)4 List (java.util.List)3 Min (org.onebusaway.collections.Min)3 StopEntryImpl (org.onebusaway.transit_data_federation.impl.transit_graph.StopEntryImpl)3 ProjectedPoint (org.onebusaway.transit_data_federation.model.ProjectedPoint)3 ShapePoints (org.onebusaway.transit_data_federation.model.ShapePoints)2 Point (com.vividsolutions.jts.geom.Point)1 Cacheable (org.onebusaway.container.cache.Cacheable)1 CoordinateBounds (org.onebusaway.geospatial.model.CoordinateBounds)1 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)1 ShapePointsFactory (org.onebusaway.transit_data_federation.model.ShapePointsFactory)1 ScheduledBlockLocation (org.onebusaway.transit_data_federation.services.blocks.ScheduledBlockLocation)1 BlockConfigurationEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockConfigurationEntry)1