Package com.vividsolutions.jts.geom.impl

Examples of com.vividsolutions.jts.geom.impl.PackedCoordinateSequenceFactory


    @Test
    public void testMovePointOnGeometry() throws Exception {
      GeometryFactory fac = new GeometryFactory();
     
      double[] coords = new double[]{10,10, 10,20, 10,30, 30,30, 20,30, 10,10};
    LinearRing ring = fac.createLinearRing(new PackedCoordinateSequenceFactory().create(coords , 2));
      Polygon poly = fac.createPolygon(ring, new LinearRing[0]);
     
      bb.clear();
      geom =  bb.addGeometry(poly, "poly").values().iterator().next();
     
View Full Code Here


        @SuppressWarnings({ "rawtypes", "unchecked" })
        @Override
        public Integer call() throws Exception {

            final Query query = new Query();
            CoordinateSequenceFactory coordSeq = new PackedCoordinateSequenceFactory();
            query.getHints().add(new Hints(Hints.JTS_COORDINATE_SEQUENCE_FACTORY, coordSeq));
            query.setStartIndex(offset);
            if (limit != null && limit.intValue() > 0) {
                query.setMaxFeatures(limit);
            }
View Full Code Here

    private void insert(final WorkingTree workTree, final String path,
            @SuppressWarnings("rawtypes") final FeatureSource featureSource,
            final ProgressListener taskProgress) {

        final Query query = new Query();
        CoordinateSequenceFactory coordSeq = new PackedCoordinateSequenceFactory();
        query.getHints().add(new Hints(Hints.JTS_COORDINATE_SEQUENCE_FACTORY, coordSeq));
        workTree.insert(path, featureSource, query, taskProgress);

    }
View Full Code Here

public class TestElevationUtils extends TestCase {

  public void testLengthMultiplier() {

    PackedCoordinateSequenceFactory factory = PackedCoordinateSequenceFactory.DOUBLE_FACTORY;
    CoordinateSequence seq = factory.create(new Coordinate[] {
        new Coordinate(0, 1), new Coordinate(10, 1) });
    SlopeCosts costs = ElevationUtils.getSlopeCosts(seq, false);
    assertEquals(1.0, costs.lengthMultiplier);
   
    seq = factory.create(new Coordinate[] {
        new Coordinate(0, 1), new Coordinate(10, 2) });
                costs = ElevationUtils.getSlopeCosts(seq, false);
    assertEquals(1.00498756211208902702, costs.lengthMultiplier);
   
    seq = factory.create(new Coordinate[] {
        new Coordinate(0, 1), new Coordinate(10, 2), new Coordinate(15, 1) });
                costs = ElevationUtils.getSlopeCosts(seq, false);
    assertEquals(1.00992634231424500668, costs.lengthMultiplier);
  }
View Full Code Here

                        + "AND geometry::STGeomFromText('POLYGON ((2 -1, 2 5, 4 5, 4 -1, 2 -1))', 4326).STContains(\"geom\") = 1");

        // the filter for the Query
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LinearRing shell = gf.createLinearRing(sf.create(new double[] { 2, -1, 2, 5, 4, 5, 4, -1,
                2, -1 }, 2));
        Polygon polygon = gf.createPolygon(shell, null);
        Contains cs = ff.contains(ff.literal(polygon), ff.property(aname("geom")));

        SimpleFeatureType roadSchema = dataStore.getSchema("road");
View Full Code Here

                + "AND geometry::STGeomFromText('POLYGON ((2 -1, 2 5, 4 5, 4 -1, 2 -1))', 4326).STContains(\"geom\") = 1");
       
        // the filter for the Query
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LinearRing shell = gf.createLinearRing(sf.create(new double[] { 2, -1, 2, 5, 4, 5, 4, -1,
                2, -1 }, 2));
        Polygon polygon = gf.createPolygon(shell, null);
        Contains cs = ff.contains(ff.literal(polygon), ff.property(aname("geom")));

       
View Full Code Here

        SimpleFeatureType schema = tb.buildFeatureType();

        ListFeatureCollection fc = new ListFeatureCollection(schema);
        SimpleFeatureBuilder fb = new SimpleFeatureBuilder(schema);

        GeometryFactory factory = new GeometryFactory(new PackedCoordinateSequenceFactory());

        Geometry point = factory.createPoint(new Coordinate(10, 10));
        fb.add(point);
        fb.add(5);
       
View Full Code Here

        SimpleFeatureType type = tb.buildFeatureType();
        SimpleFeatureBuilder fb = new SimpleFeatureBuilder(type);
        DefaultFeatureCollection fc = new DefaultFeatureCollection();

        GeometryFactory factory = new GeometryFactory(new PackedCoordinateSequenceFactory());

        for (Coordinate p : pts) {
            Geometry point = factory.createPoint(p);
            fb.add(point);
            fb.add(p.z);
View Full Code Here

        SimpleFeatureType type = tb.buildFeatureType();
        SimpleFeatureBuilder fb = new SimpleFeatureBuilder(type);
        DefaultFeatureCollection fc = new DefaultFeatureCollection();

        GeometryFactory factory = new GeometryFactory(new PackedCoordinateSequenceFactory());

        for (Coordinate p : pts) {
            Geometry point = factory.createPoint(p);
            fb.add(point);
            fb.add(p.z);
View Full Code Here

        SimpleFeatureType type = tb.buildFeatureType();
        SimpleFeatureBuilder fb = new SimpleFeatureBuilder(type);
        DefaultFeatureCollection fc = new DefaultFeatureCollection();

        GeometryFactory factory = new GeometryFactory(new PackedCoordinateSequenceFactory());

        for (Coordinate p : pts) {
            Geometry point = factory.createPoint(p);
            fb.add(point);
            fb.add(p.z);
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.impl.PackedCoordinateSequenceFactory

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.