Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Point


        }

        // pointSize = width;
        BufferedImage finalImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        BufferedImage pointImage = new BufferedImage(pointSize, pointSize, BufferedImage.TYPE_INT_ARGB);
        Point point = d.point(pointSize / 2, pointSize / 2);
        d.drawDirect(pointImage, d.feature(point), newRule);
        Graphics2D g2d = finalImage.createGraphics();
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        if (pointSize > width || pointSize > height) {
View Full Code Here


                    continue;
                }

                // and then create the features
                Coordinate c = new Coordinate(lon, lat);
                Point point = gF.createPoint(c);
                Geometry reprojectPoint = JTS.transform(point, transform);

                SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
                Object[] values = new Object[]{reprojectPoint, text, dateTimeString, String.valueOf(altim)};
                builder.addAll(values);
View Full Code Here

            int index = 0;
            for( GpsLog log : logsList ) {
                List<GpsPoint> gpsPointList = log.points;
                for( GpsPoint gpsPoint : gpsPointList ) {
                    Coordinate c = new Coordinate(gpsPoint.lon, gpsPoint.lat);
                    Point point = gF.createPoint(c);

                    Point reprojectPoint = (Point) JTS.transform(point, transform);
                    Object[] values = new Object[]{reprojectPoint, String.valueOf(gpsPoint.altim), gpsPoint.utctime};

                    SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
                    builder.addAll(values);
                    SimpleFeature feature = builder.buildFeature(featureType.getTypeName() + "." + index++);
View Full Code Here

                        lon = Double.parseDouble(lonString);
                    }
                    double altim = Double.parseDouble(altimString);

                    Coordinate c = new Coordinate(lon, lat);
                    Point point = gF.createPoint(c);

                    String imageRelativePath = imageFolderName + "/" + imageFile.getName();
                    File newImageFile = new File(outputFolderFile, imageRelativePath);
                    FileUtils.copyFile(imageFile, newImageFile);

                    Point reprojectPoint = (Point) JTS.transform(point, transform);
                    String dateTime = dateString + timeString;
                    Object[] values = new Object[]{reprojectPoint, String.valueOf(altim), dateTime, azimuth, imageRelativePath};

                    SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
                    builder.addAll(values);
View Full Code Here

       
        Hashtable table = (Hashtable)vec.get(0);
        double lat = ((Number)table.get("lat")).doubleValue(); //$NON-NLS-1$
        double lon = ((Number)table.get("long")).doubleValue(); //$NON-NLS-1$
        Coordinate c = new Coordinate(lon, lat);
        Point p = fac.createPoint(c);
        return p;
    }
View Full Code Here

                        MathTransform transform = CRS.findMathTransform(placeCrs, mapCrs, true);
                        // jts geometry
                        int selectionIndex = placesCombo.getSelectionIndex();
                        String item = placesCombo.getItem(selectionIndex);
                        Coordinate coordinate = placesMap.get(item);
                        Point pt = gF.createPoint(coordinate);
                        Geometry targetGeometry = JTS.transform(pt, transform);
                        Coordinate position = targetGeometry.getCoordinate();

                        Coordinate centre = bounds.centre();
                        double xTrans = position.x - centre.x;
View Full Code Here

                Object[] values = new Object[fieldNames.size() - 1];

                String[] lineSplit = line.split(separator);
                double x = Double.parseDouble(lineSplit[xIndex]);
                double y = Double.parseDouble(lineSplit[yIndex]);
                Point point = gf.createPoint(new Coordinate(x, y));
                values[0] = point;

                int objIndex = 1;
                for( int i = 0; i < lineSplit.length; i++ ) {
                    if (i == xIndex || i == yIndex) {
View Full Code Here

    @Before
    public void setUp() throws Exception {
        handler=new TestHandler();
        map=(Map) handler.getContext().getMap();
        GeometryFactory fac=new GeometryFactory();
        Point geom=fac.createPoint(new Coordinate(-564121,-1632497));
        SimpleFeature[] feature = UDIGTestUtil.createTestFeatures("test", new Point[]{geom}, new String[]{"name"}, CRS.decode("EPSG:2065")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        Layer layer = map.getLayerFactory().createLayer(CatalogTests.createGeoResource(feature, true));
        map.getLayersInternal().add( layer );
        map.getViewportModelInternal().setCRS(DefaultGeographicCRS.WGS84);
        map.getViewportModelInternal().zoomToBox(layer.getBounds(null, map.getViewportModel().getCRS()));
View Full Code Here

  final GeometryFactory geomFactory = polygonGeometry.getFactory();

  boolean allOutside = true;
  for (int i = 0; i < coordinates.length; i++) {

      Point point = geomFactory.createPoint(coordinates[i]);
      // check the points is inside the polygon.
      // if some one is inside, will return.
      if (polygonGeometry.contains(point)) {
    allOutside = false;
    break;
View Full Code Here

     */
    private static boolean isCoordOutSidePolygon(
      final Geometry polygonGeometry, final Coordinate[] lineCoords,
      final int indexInLineCoords, final GeometryFactory fc) {

  Point point = fc.createPoint(lineCoords[indexInLineCoords]);
  if (polygonGeometry.disjoint(point)) {
      return true;
  }
  if (polygonGeometry.touches(point)) {

View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.Point

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.