Package de.micromata.opengis.kml.v_2_2_0

Examples of de.micromata.opengis.kml.v_2_2_0.NetworkLink


        .withName(worksheet.getTitle()).withOpen(true);

    Style style = folder.createAndAddStyle().withId("karma");
   
    if(randomCounter++%2 == 0)
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/blue-pushpin.png"));
    else
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/red-pushpin.png"));

    for (edu.isi.karma.geospatial.Point point : points) {
      folder.createAndAddPlacemark()
          .withDescription(point.getHTMLDescription())
          .withVisibility(true)
View Full Code Here


    return columnNameMap;
  }

  public File publishKML() throws FileNotFoundException {
    File outputFile = new File(ServletContextParameterMap.getParameterValue(ContextParameter.USER_DIRECTORY_PATH) + "KML/" + worksheet.getTitle() + ".kml");
    final Kml kml = KmlFactory.createKml();
    final Folder folder = kml.createAndSetFolder()
        .withName(worksheet.getTitle()).withOpen(true);

    Style style = folder.createAndAddStyle().withId("karma");
   
    if(randomCounter++%2 == 0)
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/blue-pushpin.png"));
    else
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/red-pushpin.png"));

    for (edu.isi.karma.geospatial.Point point : points) {
      folder.createAndAddPlacemark()
          .withDescription(point.getHTMLDescription())
          .withVisibility(true)
          .withStyleUrl("karma")
          .createAndSetPoint()
          .withAltitudeMode(AltitudeMode.CLAMP_TO_GROUND)
          .addToCoordinates(
              point.getLongitude() + "," + point.getLatitude());

    }

    for (edu.isi.karma.geospatial.LineString line : lines) {
      folder.createAndAddPlacemark()
          .withDescription(line.getHTMLDescription())
          .withVisibility(true).createAndSetLineString()
          .withAltitudeMode(AltitudeMode.CLAMP_TO_GROUND)
          .setCoordinates(line.getCoordinatesList());
    }
    int n=0;
    for (Polygon polygon: polygons) {
      FeatureTable featureTable = polygonTable.get(n);
     
      Placemark placemark = folder.createAndAddPlacemark()
      .withDescription(featureTable.getHTMLDescription())
      .withVisibility(true);
     
      final de.micromata.opengis.kml.v_2_2_0.Polygon kmlPolygon = new de.micromata.opengis.kml.v_2_2_0.Polygon();
      placemark.setGeometry(kmlPolygon);

      kmlPolygon.setExtrude(true);
      kmlPolygon.setAltitudeMode(AltitudeMode.CLAMP_TO_GROUND);

      final Boundary outerboundary = new Boundary();
      kmlPolygon.setOuterBoundaryIs(outerboundary);

      final LinearRing outerlinearring = new LinearRing();
      outerboundary.setLinearRing(outerlinearring);

      List<Coordinate> outercoord = new ArrayList<Coordinate>();
      outerlinearring.setCoordinates(outercoord);
      for (int i=0;i<polygon.getExteriorRing().getNumPoints();i++) {
        outercoord.add(new Coordinate(polygon.getExteriorRing().getPointN(i).getX(),polygon.getExteriorRing().getPointN(i).getY()));
      }
     
      int numOfInnerBoundaries = polygon.getNumInteriorRing();
      for(int i=0;i<numOfInnerBoundaries;i++)
      {
        final Boundary innerboundary = new Boundary();
        kmlPolygon.getInnerBoundaryIs().add(innerboundary);
 
        final LinearRing innerlinearring = new LinearRing();
        innerboundary.setLinearRing(innerlinearring);
 
        List<Coordinate> innercoord = new ArrayList<Coordinate>();
        innerlinearring.setCoordinates(innercoord);
        int numOfPoints = polygon.getInteriorRingN(i).getNumPoints();
        for(int j=0;j<numOfPoints;j++)
          innercoord.add(new Coordinate(polygon.getInteriorRingN(i).getPointN(j).getX(),polygon.getInteriorRingN(i).getPointN(j).getY()));
       
      }
     
     
    }
    kml.marshal(outputFile);
    logger.info("KML file published. Location:"
        + outputFile.getAbsolutePath());
    return outputFile;
  }
View Full Code Here

      kmlPolygon.setAltitudeMode(AltitudeMode.CLAMP_TO_GROUND);

      final Boundary outerboundary = new Boundary();
      kmlPolygon.setOuterBoundaryIs(outerboundary);

      final LinearRing outerlinearring = new LinearRing();
      outerboundary.setLinearRing(outerlinearring);

      List<Coordinate> outercoord = new ArrayList<Coordinate>();
      outerlinearring.setCoordinates(outercoord);
      for (int i=0;i<polygon.getExteriorRing().getNumPoints();i++) {
        outercoord.add(new Coordinate(polygon.getExteriorRing().getPointN(i).getX(),polygon.getExteriorRing().getPointN(i).getY()));
      }
     
      int numOfInnerBoundaries = polygon.getNumInteriorRing();
      for(int i=0;i<numOfInnerBoundaries;i++)
      {
        final Boundary innerboundary = new Boundary();
        kmlPolygon.getInnerBoundaryIs().add(innerboundary);
 
        final LinearRing innerlinearring = new LinearRing();
        innerboundary.setLinearRing(innerlinearring);
 
        List<Coordinate> innercoord = new ArrayList<Coordinate>();
        innerlinearring.setCoordinates(innercoord);
        int numOfPoints = polygon.getInteriorRingN(i).getNumPoints();
        for(int j=0;j<numOfPoints;j++)
          innercoord.add(new Coordinate(polygon.getInteriorRingN(i).getPointN(j).getX(),polygon.getInteriorRingN(i).getPointN(j).getY()));
       
      }
View Full Code Here

     * this.setAbstractView(lookAt); </code>
     *
     *
     */
    public LookAt createAndSetLookAt() {
        LookAt newValue = new LookAt();
        this.setAbstractView(newValue);
        return newValue;
    }
View Full Code Here

     * this.setAbstractView(lookAt); </code>
     *
     *
     */
    public LookAt createAndSetLookAt() {
        LookAt newValue = new LookAt();
        this.setAbstractView(newValue);
        return newValue;
    }
View Full Code Here

     * this.setModel(model); </code>
     *
     *
     */
    public Model createAndSetModel() {
        Model newValue = new Model();
        this.setModel(newValue);
        return newValue;
    }
View Full Code Here

           
            return folder;
        }
       
        private void encodeSequentialNetworkLink(Folder folder, String linkbase, int start, int maxFeatures, String id, String readableName) {
            NetworkLink nl = folder.createAndAddNetworkLink();
            Link link = nl.createAndSetLink();
            link.setHref(linkbase + "?startindex=" + start + "&maxfeatures=" + maxFeatures);
            nl.setDescription(readableName);
            nl.setId(id);
        }
View Full Code Here

            }
        }
    }

    public void encodeGWCLink(Document container, GetMapRequest request, MapLayerInfo layer) {
        NetworkLink nl = container.createAndAddNetworkLink();
        String prefixedName = layer.getResource().prefixedName();
        nl.setName("GWC-" + prefixedName);
        Link link = nl.createAndSetLink();
        String type = layer.getType() == MapLayerInfo.TYPE_RASTER ? "png" : "kml";
        String url = ResponseUtils.buildURL(request.getBaseUrl(), "gwc/service/kml/" + prefixedName
                + "." + type + ".kml", null, URLType.SERVICE);
        link.setHref(url);
        link.setViewRefreshMode(ViewRefreshMode.NEVER);
View Full Code Here

        String overlayMode = context.getSuperOverlayMode();
        if (!"raster".equals(overlayMode) && layer instanceof FeatureLayer && !shouldDrawVectorLayer(layer, box)) {
            return;
        }

        NetworkLink nl = container.createAndAddNetworkLink();
        nl.setName(name);
        addRegion(nl, box, 128, -1);
        Link link = nl.createAndSetLink();
        String getMap = WMSRequests.getGetMapUrl(request, layer, 0, box, new String[] { "format",
                KMLMapOutputFormat.MIME_TYPE, "width", "256", "height", "256", "format", NetworkLinkMapOutputFormat.KML_MIME_TYPE  });
        link.setHref(getMap);
        LOGGER.fine("Network link " + name + ":" + getMap);
        link.setViewRefreshMode(ViewRefreshMode.ON_REGION);
View Full Code Here

        }
        String foEncoded = WMSRequests.encodeFormatOptions(fo);

        // encode the link
        NetworkLink nl = container.createAndAddNetworkLink();
        nl.setName(name);
        addRegion(nl, box, 128, -1);
        nl.setVisibility(true);
        Link link = nl.createAndSetLink();
        String url = WMSRequests.getGetMapUrl(request, layer, 0, box, new String[] { "width",
                "256", "height", "256", "format_options", foEncoded, "superoverlay", "true"});
        link.setHref(url);
    }
View Full Code Here

TOP

Related Classes of de.micromata.opengis.kml.v_2_2_0.NetworkLink

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.