Package org.worldbank.transport.tamt.shared

Examples of org.worldbank.transport.tamt.shared.Vertex


      @Override
      public void onUpdate(CurrentStudyRegionUpdatedEvent event) {
        currentStudyRegion = event.studyRegion;
        if( currentStudyRegion != null)
        {
          Vertex v = currentStudyRegion.getMapCenter();
          final LatLng center = LatLng.newInstance(v.getLat(), v.getLng());
         
          // since we have a new current study region, clear map overlays
          map.clearOverlays();
       
          // do this as a deferred command
View Full Code Here


    if( vertices != null)
    {
      LatLng[] points = new LatLng[vertices.size()];
      int count = 0;
      for (Iterator iterator = vertices.iterator(); iterator.hasNext();) {
        Vertex v = (Vertex) iterator.next();
        LatLng p = LatLng.newInstance(v.getLat(), v.getLng());
        points[count] = p;
        count++;
      }
      final TagPolygon polygon = new TagPolygon(points, polygonColor, weight, opacity, polygonColor, opacity);
      polygon.setZoneDetailsId(zoneDetailsId);
View Full Code Here

    if( vertices != null)
    {
      LatLng[] points = new LatLng[vertices.size()];
      int count = 0;
      for (Iterator iterator = vertices.iterator(); iterator.hasNext();) {
        Vertex v = (Vertex) iterator.next();
        LatLng p = LatLng.newInstance(v.getLat(), v.getLng());
        points[count] = p;
        count++;
      }
      final TagPolyline polyline = new TagPolyline(points, polylineColor, weight, opacity);
      polyline.setRoadDetailsId(roadDetailsId);
View Full Code Here

    ArrayList<Vertex> vertices = new ArrayList<Vertex>();
    if( polygon != null)
    {
      for (int i = 0; i < polygon.getVertexCount(); i++) {
        LatLng latLng = polygon.getVertex(i);
        Vertex v = new Vertex();
        v.setLat(latLng.getLatitude());
        v.setLng(latLng.getLongitude());
        vertices.add(v);
      }
    } else {
      throw new Exception("Please draw a zone before saving zone details");
    }
View Full Code Here

   
    int vertexCount = vertices.size();
    //TODO: handle null vertices
    Coordinate[] coords = new Coordinate[vertexCount];
    for (int i = 0; i < vertexCount; i++) {
      Vertex v = vertices.get(i);
      Coordinate c = new Coordinate(v.getLng(), v.getLat());
      coords[i] = c;
    }
    // now create a line string from the coordinates array
    Geometry geometry = new GeometryFactory().createLineString(coords);
   
View Full Code Here

            // set in the roadDetails
            ArrayList<Vertex> vertices = Utils.geometryToVertexArrayList(geometry);
            fetched.setVertices(vertices);
           
            // convert the centroid point into a Vertex
            Vertex centroid = new Vertex();
            centroid.setLat(centroidJTS.getY());
            centroid.setLng(centroidJTS.getX());
            fetched.setCentroid(centroid);
           
            // and get the map meta data too
            Geometry mapCenterGeom = reader.read(mapCenterWKT);
            Point mapCenterJTS = mapCenterGeom.getCentroid();
            Vertex mapCenterVertex = new Vertex();
            mapCenterVertex.setLat(mapCenterJTS.getY());
            mapCenterVertex.setLng(mapCenterJTS.getX());
            fetched.setMapCenter(mapCenterVertex);
      }
    } catch (SQLException e) {
      logger.error(e.getMessage());
      throw e;
View Full Code Here

            // set in the roadDetails
            ArrayList<Vertex> vertices = Utils.geometryToVertexArrayList(geometry);
            studyRegion.setVertices(vertices);
           
            // convert the centroid point into a Vertex
            Vertex centroid = new Vertex();
            centroid.setLat(centroidJTS.getY());
            centroid.setLng(centroidJTS.getX());
            studyRegion.setCentroid(centroid);
           
            // and get the map meta data too
            Geometry mapCenterGeom = reader.read(mapCenterWKT);
            Point mapCenterJTS = mapCenterGeom.getCentroid();
            Vertex mapCenterVertex = new Vertex();
            mapCenterVertex.setLat(mapCenterJTS.getY());
            mapCenterVertex.setLng(mapCenterJTS.getX());
            studyRegion.setMapCenter(mapCenterVertex);
           
           
            studyRegionList.add(studyRegion);
      }
View Full Code Here

            // set in the roadDetails
            ArrayList<Vertex> vertices = Utils.geometryToVertexArrayList(geometry);
            roadDetails.setVertices(vertices);
           
            // convert the centroid point into a Vertex
            Vertex centroid = new Vertex();
            centroid.setLat(centroidJTS.getY());
            centroid.setLng(centroidJTS.getX());
            roadDetails.setCentroid(centroid);
           
            //TODO: Do we need to include the study region name, description here?
            StudyRegion sr = new StudyRegion();
            sr.setId(regionId);
View Full Code Here

            // set in the roadDetails
            ArrayList<Vertex> vertices = Utils.geometryToVertexArrayList(geometry);
            zoneDetails.setVertices(vertices);
           
            // convert the centroid point into a Vertex
            Vertex centroid = new Vertex();
            centroid.setLat(centroidJTS.getY());
            centroid.setLng(centroidJTS.getX());
            zoneDetails.setCentroid(centroid);
           
            //TODO: do I need to include the study region id, description here?
            zoneDetails.setRegion(region);
           
View Full Code Here

TOP

Related Classes of org.worldbank.transport.tamt.shared.Vertex

Copyright © 2018 www.massapicom. 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.