private static OGCPoint readPoint(BasicSliceInput input) { double x = input.readDouble(); double y = input.readDouble(); Point point; if (isNaN(x) || isNaN(y)) { point = new Point(); } else { point = new Point(x, y); } return new OGCPoint(point, null); }
private void assertEnvelopeAsPts(String wkt, Point lowerLeftCorner, Point upperRightCorner) { assertFunction(format("transform(ST_EnvelopeAsPts(ST_GeometryFromText('%s')), x -> ST_AsText(x))", wkt), new ArrayType(VARCHAR), ImmutableList.of(new OGCPoint(lowerLeftCorner, null).asText(), new OGCPoint(upperRightCorner, null).asText())); }
public void eval() { double lon = lonParam.value; double lat = latParam.value; com.esri.core.geometry.ogc.OGCPoint point = new com.esri.core.geometry.ogc.OGCPoint( new com.esri.core.geometry.Point(lon, lat), com.esri.core.geometry.SpatialReference.create(4326)); java.nio.ByteBuffer pointBytes = point.asBinary(); out.buffer = buffer; out.start = 0; out.end = pointBytes.remaining(); buffer.setBytes(0, pointBytes); } }
private List<OGCGeometry> makeGeometries() { ImmutableList.Builder<OGCGeometry> geometries = ImmutableList.builder(); for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { geometries.add(new OGCPoint(new Point(-10 + i, -10 + j), null)); } } for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { geometries.add(new OGCPoint(new Point(-10 + 2 * i, 2 * j), null)); } } for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { geometries.add(new OGCPoint(new Point(2.5 * i, -10 + 2.5 * j), null)); } } for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { geometries.add(new OGCPoint(new Point(5 * i, 5 * j), null)); } } return geometries.build(); }
result = transform.transform(new org.osgeo.proj4j.ProjCoordinate(pointGeom.X(), pointGeom.Y()), result); geomBytes = new com.esri.core.geometry.ogc.OGCPoint( new com.esri.core.geometry.Point(result.x, result.y), sr).asBinary(); } else {
@Override public void init() throws HyracksDataException { // Initialize the resulting geometry with an empty point. geometry = new OGCPoint(new Point(), DEFAULT_CRS); }
private static OGCPoint readPoint(BasicSliceInput input) { double x = input.readDouble(); double y = input.readDouble(); Point point; if (isNaN(x) || isNaN(y)) { point = new Point(); } else { point = new Point(x, y); } return new OGCPoint(point, null); }
private static OGCPoint readPoint(BasicSliceInput input) { double x = input.readDouble(); double y = input.readDouble(); Point point; if (isNaN(x) || isNaN(y)) { point = new Point(); } else { point = new Point(x, y); } return new OGCPoint(point, null); }
private static OGCPoint readPoint(BasicSliceInput input) { double x = input.readDouble(); double y = input.readDouble(); Point point; if (isNaN(x) || isNaN(y)) { point = new Point(); } else { point = new Point(x, y); } return new OGCPoint(point, null); }
@Override public double distanceTo(double x, double y) { OGCPoint point = new OGCPoint(new com.esri.core.geometry.Point(x, y), this.geom.getEsriSpatialReference()); return this.geom.distance(point); }
private void assertEnvelopeAsPts(String wkt, Point lowerLeftCorner, Point upperRightCorner) { assertFunction(format("transform(ST_EnvelopeAsPts(ST_GeometryFromText('%s')), x -> ST_AsText(x))", wkt), new ArrayType(VARCHAR), ImmutableList.of(new OGCPoint(lowerLeftCorner, null).asText(), new OGCPoint(upperRightCorner, null).asText())); }
public STMakePointEvaluator(IScalarEvaluatorFactory[] args, IHyracksTaskContext ctx) throws HyracksDataException { resultStorage = new ArrayBackedValueStorage(); out = resultStorage.getDataOutput(); inputArg0 = new VoidPointable(); inputArg1 = new VoidPointable(); eval0 = args[0].createScalarEvaluator(ctx); eval1 = args[1].createScalarEvaluator(ctx); point = new Point(0, 0); pointGeometry = new AGeometry(new OGCPoint(point, SpatialReference.create(4326))); }
private void assertEnvelopeAsPts(String wkt, Point lowerLeftCorner, Point upperRightCorner) { assertFunction(format("transform(ST_EnvelopeAsPts(ST_GeometryFromText('%s')), x -> ST_AsText(x))", wkt), new ArrayType(VARCHAR), ImmutableList.of(new OGCPoint(lowerLeftCorner, null).asText(), new OGCPoint(upperRightCorner, null).asText())); }
@Override public OGCGeometry reduceFromMulti() { int n = numGeometries(); if (n == 0) { return new OGCPoint(new Point(multiPoint.getDescription()), esriSR); } if (n == 1) { return geometryN(0); } return this; }
@Override public OGCGeometry reduceFromMulti() { int n = numGeometries(); if (n == 0) { return new OGCPoint(new Point(multiPoint.getDescription()), esriSR); } if (n == 1) { return geometryN(0); } return this; }
@Override public boolean isIntersected(Shape s) { Rectangle s_mbr = s.getMBR(); Rectangle this_mbr = this.getMBR(); if (s_mbr == null || this_mbr == null) return false; // Filter step if (!s_mbr.isIntersected(this_mbr)) return false; try { if (s instanceof OGCESRIShape) return geom.intersects(((OGCESRIShape)s).geom); } catch (NullPointerException e) { // TODO Auto-generated catch block e.printStackTrace(); } ArrayList<OGCGeometry> points = new ArrayList<OGCGeometry>(); points.add(new OGCPoint(new com.esri.core.geometry.Point(s_mbr.x1, s_mbr.y1), geom.getEsriSpatialReference())); points.add(new OGCPoint(new com.esri.core.geometry.Point(s_mbr.x2, s_mbr.y2), geom.getEsriSpatialReference())); OGCGeometryCollection all_points = new OGCConcreteGeometryCollection(points, geom.getEsriSpatialReference()); return geom.intersects(all_points.envelope()); }
public STMakePoint3DEvaluator(IScalarEvaluatorFactory[] args, IHyracksTaskContext ctx) throws HyracksDataException { resultStorage = new ArrayBackedValueStorage(); out = resultStorage.getDataOutput(); inputArg0 = new VoidPointable(); inputArg1 = new VoidPointable(); inputArg2 = new VoidPointable(); eval0 = args[0].createScalarEvaluator(ctx); eval1 = args[1].createScalarEvaluator(ctx); eval2 = args[2].createScalarEvaluator(ctx); point = new Point(0, 0, 0); pointGeometry = new AGeometry(new OGCPoint(point, SpatialReference.create(4326))); }
@Override public DataByteArray exec(Tuple input) throws IOException { if (input.size() != 2) throw new GeoException("MakePoint takes two numerical arguments"); double x = ESRIGeometryParser.parseDouble(input.get(0)); double y = ESRIGeometryParser.parseDouble(input.get(1)); Point point = new Point(x, y); OGCPoint ogc_point = new OGCPoint(point, SpatialReference.create(4326)); return new DataByteArray(ogc_point.asBinary().array()); } }
public STMakePoint3DWithMEvaluator(IScalarEvaluatorFactory[] args, IHyracksTaskContext ctx) throws HyracksDataException { resultStorage = new ArrayBackedValueStorage(); out = resultStorage.getDataOutput(); inputArg0 = new VoidPointable(); inputArg1 = new VoidPointable(); inputArg2 = new VoidPointable(); inputArg3 = new VoidPointable(); eval0 = args[0].createScalarEvaluator(ctx); eval1 = args[1].createScalarEvaluator(ctx); eval2 = args[2].createScalarEvaluator(ctx); eval3 = args[3].createScalarEvaluator(ctx); point = new Point(0, 0, 0); pointGeometry = new AGeometry(new OGCPoint(point, SpatialReference.create(4326))); }