Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPoint()


            }
            if( Double.isNaN( lat ) || Double.isNaN( lon )){
                System.out.println("missed location - " );                 //$NON-NLS-1$
            }
            else {
                values[index] = fac.createPoint( new Coordinate(lon, lat) );
            }
            try{
                SimpleFeature f = SimpleFeatureBuilder.build(ADDRESS, values, fid( count++, table ) );
                places.add( f );
            } catch(Exception e){
View Full Code Here


            Coordinate c=map.getViewportModel().pixelToWorld(i*10,0);
            FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
      Set<Identifier> ids = new HashSet<Identifier>();
      ids.add(filterFactory.featureId(feature.getID()));
      GeometryDescriptor defaultGeometry = feature.getFeatureType().getGeometryDescriptor();
      resource.modifyFeatures(defaultGeometry, fac.createPoint(c),
                    filterFactory.id(ids));
        }
        ((EditManager)map.getEditManager()).commitTransaction();

        handler=new TestHandler();
View Full Code Here

        for( FeatureIterator<SimpleFeature> iter = source.getFeatures().features(); iter.hasNext(); ){
            SimpleFeature feature = iter.next();
            source.modifyFeatures(feature.getFeatureType().getDescriptor("name"), "feature"+i, filterFac.id(FeatureUtils.stringToId(filterFac, feature.getID())))//$NON-NLS-1$//$NON-NLS-2$
            Geometry geom;
            if( i==0 ){
                geom=geomFac.createPoint(new Coordinate(0,10));
            }else if( i==1 ){
                geom=geomFac.createLineString(new Coordinate[]{
                        new Coordinate( 10,10), new Coordinate(10,20)
                });
            }else{
View Full Code Here

        assertEquals(null, editBlackboardEvent.getOldValue());
        assertEquals(Point.valueOf(10,10), editBlackboardEvent.getNewValue());
        assertEquals(map.getGeoms().get(0).getShell(), editBlackboardEvent.getSource());

        GeometryFactory factory=new GeometryFactory();
        Geometry geom=factory.createPoint(new Coordinate(10,5));
        map=new EditBlackboard(SCREEN.x,SCREEN.y, transform, layerToWorld);
        map.getListeners().add(l);
        Map<Geometry, EditGeom> mapping = map.setGeometries(geom, null);
        assertNotNull(mapping.get(geom));
        assertEquals(ShapeType.POINT, mapping.get(geom).getShapeType());
View Full Code Here

    @Test
    public void testAddCoord() {
        EventListener l=new EventListener();
       
        GeometryFactory factory=new GeometryFactory();
        Geometry geom=factory.createPoint(new Coordinate(10,5));
        EditBlackboard map = new EditBlackboard(SCREEN.x,SCREEN.y, transform, layerToWorld);
        map.getListeners().add(l);

        map.setGeometries(geom, null);
        assertPixMapState(map,1,1,0,0);
View Full Code Here

        EditBlackboard map = new EditBlackboard(SCREEN.x,SCREEN.y, new AffineTransform(), layerToWorld);
        map.getListeners().add(l);

        GeometryFactory factory=new GeometryFactory();
        map.getListeners().add(l);
        map.setGeometries(factory.createPoint(new Coordinate(10,10)), null);
        map.addGeometry(factory.createPoint(new Coordinate(20,10)), null);
        Coordinate coordinate = new Coordinate(30,10);
        map.addGeometry(factory.createPoint(coordinate), null);
        Coordinate coordinate2 = new Coordinate(40,10);
        map.addGeometry(factory.createPoint(coordinate2), null);
View Full Code Here

        map.getListeners().add(l);

        GeometryFactory factory=new GeometryFactory();
        map.getListeners().add(l);
        map.setGeometries(factory.createPoint(new Coordinate(10,10)), null);
        map.addGeometry(factory.createPoint(new Coordinate(20,10)), null);
        Coordinate coordinate = new Coordinate(30,10);
        map.addGeometry(factory.createPoint(coordinate), null);
        Coordinate coordinate2 = new Coordinate(40,10);
        map.addGeometry(factory.createPoint(coordinate2), null);
       
View Full Code Here

        GeometryFactory factory=new GeometryFactory();
        map.getListeners().add(l);
        map.setGeometries(factory.createPoint(new Coordinate(10,10)), null);
        map.addGeometry(factory.createPoint(new Coordinate(20,10)), null);
        Coordinate coordinate = new Coordinate(30,10);
        map.addGeometry(factory.createPoint(coordinate), null);
        Coordinate coordinate2 = new Coordinate(40,10);
        map.addGeometry(factory.createPoint(coordinate2), null);
       
        List<EditGeom> toRemove=new ArrayList<EditGeom>(map.getGeoms());
        toRemove.remove(0);
View Full Code Here

        map.setGeometries(factory.createPoint(new Coordinate(10,10)), null);
        map.addGeometry(factory.createPoint(new Coordinate(20,10)), null);
        Coordinate coordinate = new Coordinate(30,10);
        map.addGeometry(factory.createPoint(coordinate), null);
        Coordinate coordinate2 = new Coordinate(40,10);
        map.addGeometry(factory.createPoint(coordinate2), null);
       
        List<EditGeom> toRemove=new ArrayList<EditGeom>(map.getGeoms());
        toRemove.remove(0);
        toRemove.remove(0);
       
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

TOP
Copyright © 2018 www.massapi.com. 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.