├── VERSION ├── .gitignore ├── python ├── epl_protobuf │ ├── VERSION │ ├── epl │ │ ├── __init__.py │ │ └── protobuf │ │ │ └── __init__.py │ ├── requirements.txt │ ├── README.md │ └── setup.py └── epl_geometry │ ├── test │ └── __init__.py │ ├── .dockerignore │ ├── requirements-test.txt │ ├── setup.cfg │ ├── epl │ └── __init__.py │ ├── requirements.txt │ ├── Dockerfile │ ├── docker-compose.yaml │ └── setup.py ├── java └── geometry-chain │ ├── epl-geometry-api │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── com │ │ │ │ │ └── esri │ │ │ │ │ └── core │ │ │ │ │ └── geometry │ │ │ │ │ ├── intermediate_to_old_wkid.txt │ │ │ │ │ ├── pcs_tolerances.txt │ │ │ │ │ └── gcs_tolerances.txt │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── esri │ │ │ │ └── core │ │ │ │ └── geometry │ │ │ │ ├── StringCursor.java │ │ │ │ ├── ProjectionTransformation.java │ │ │ │ ├── MapOGCStructure.java │ │ │ │ ├── WkbByteOrder.java │ │ │ │ ├── OGCStructure.java │ │ │ │ ├── PeDouble.java │ │ │ │ ├── UserCancelException.java │ │ │ │ ├── Interop.java │ │ │ │ ├── ogc │ │ │ │ ├── OGCMultiSurface.java │ │ │ │ ├── OGCSurface.java │ │ │ │ ├── OGCGeometryCollection.java │ │ │ │ ├── OGCMultiCurve.java │ │ │ │ └── OGCCurve.java │ │ │ │ ├── ClassicSort.java │ │ │ │ ├── OperatorImportFromWktCursor.java │ │ │ │ ├── OperatorGeodeticLengthLocal.java │ │ │ │ ├── SimpleStateEnum.java │ │ │ │ ├── WktImportFlags.java │ │ │ │ ├── OperatorImportFromWkbCursor.java │ │ │ │ ├── WkbImportFlags.java │ │ │ │ ├── OperatorImportFromEWkbCursor.java │ │ │ │ ├── OperatorIntersects.java │ │ │ │ ├── OperatorOverlapsLocal.java │ │ │ │ ├── OperatorRelateLocal.java │ │ │ │ ├── OperatorEqualsLocal.java │ │ │ │ ├── OperatorTouchesLocal.java │ │ │ │ ├── OperatorWithinLocal.java │ │ │ │ ├── OperatorContainsLocal.java │ │ │ │ ├── OperatorCrossesLocal.java │ │ │ │ ├── OperatorDisjointLocal.java │ │ │ │ ├── Proximity2DResultComparator.java │ │ │ │ ├── OperatorOverlaps.java │ │ │ │ ├── OperatorCentroid2D.java │ │ │ │ ├── ShapeImportFlags.java │ │ │ │ ├── OperatorEquals.java │ │ │ │ ├── OperatorContains.java │ │ │ │ ├── OperatorCrosses.java │ │ │ │ ├── OperatorTouches.java │ │ │ │ ├── OperatorWithin.java │ │ │ │ ├── SegmentFlags.java │ │ │ │ ├── OperatorDisjoint.java │ │ │ │ ├── OperatorIntersectsLocal.java │ │ │ │ ├── OperatorExportToWkt.java │ │ │ │ ├── GeoJsonImportFlags.java │ │ │ │ ├── OperatorGeodeticAreaLocal.java │ │ │ │ ├── OperatorFactory.java │ │ │ │ ├── GeometryException.java │ │ │ │ ├── PathFlags.java │ │ │ │ ├── OperatorBoundaryLocal.java │ │ │ │ ├── OperatorGeodeticDensifyLocal.java │ │ │ │ ├── OperatorDistance.java │ │ │ │ ├── GeometryCursorAppend.java │ │ │ │ ├── OperatorImportFromJsonLocal.java │ │ │ │ ├── OperatorConvexHullLocal.java │ │ │ │ ├── OperatorShapePreservingDensifyLocal.java │ │ │ │ ├── OperatorClipLocal.java │ │ │ │ ├── OperatorExportToWktCursor.java │ │ │ │ ├── OperatorClipCursor.java │ │ │ │ ├── OperatorGeodesicBufferLocal.java │ │ │ │ ├── JsonCursor.java │ │ │ │ ├── OperatorUnionLocal.java │ │ │ │ ├── JsonGeometryException.java │ │ │ │ ├── OperatorImportFromGeoJsonCursor.java │ │ │ │ ├── WkbExportFlags.java │ │ │ │ ├── SimpleJsonCursor.java │ │ │ │ ├── OperatorImportFromESRIShapeLocal.java │ │ │ │ ├── ShapeExportFlags.java │ │ │ │ ├── OperatorGeneralizeLocal.java │ │ │ │ ├── OperatorBoundaryLocalCursor.java │ │ │ │ ├── OperatorClip.java │ │ │ │ ├── OperatorExportToWkbCursor.java │ │ │ │ ├── OperatorDensifyByLengthLocal.java │ │ │ │ ├── JSONUtils.java │ │ │ │ ├── OperatorOffsetLocal.java │ │ │ │ ├── OperatorExportToEWkbLocal.java │ │ │ │ ├── ShapeModifiers.java │ │ │ │ ├── OperatorDifferenceCursor.java │ │ │ │ ├── MapGeometryCursor.java │ │ │ │ └── OperatorExportToJsonLocal.java │ │ └── test │ │ │ ├── resources │ │ │ └── com │ │ │ │ └── esri │ │ │ │ └── core │ │ │ │ └── geometry │ │ │ │ ├── savedPoint.txt │ │ │ │ ├── savedPoint1.txt │ │ │ │ ├── savedPolygon.txt │ │ │ │ ├── savedAreaUnit.txt │ │ │ │ ├── savedEnvelope.txt │ │ │ │ ├── savedEnvelope1.txt │ │ │ │ ├── savedPolygon1.txt │ │ │ │ ├── savedPolyline.txt │ │ │ │ ├── savedPolyline1.txt │ │ │ │ ├── savedAngularUnit.txt │ │ │ │ ├── savedEnvelope2D.txt │ │ │ │ ├── savedLinearUnit.txt │ │ │ │ ├── savedMultiPoint.txt │ │ │ │ ├── savedMultiPoint1.txt │ │ │ │ ├── savedSpatialReference.txt │ │ │ │ └── savedProjectionTransformation.txt │ │ │ └── java │ │ │ └── com │ │ │ └── esri │ │ │ └── core │ │ │ └── geometry │ │ │ └── TestWkid.java │ └── build.gradle │ ├── epl-geometry-api-ex │ ├── settings.gradle │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── org │ │ │ │ └── epl │ │ │ │ └── geometry │ │ │ │ ├── savedPoint.txt │ │ │ │ ├── savedPoint1.txt │ │ │ │ ├── savedPolygon.txt │ │ │ │ ├── savedAreaUnit.txt │ │ │ │ ├── savedEnvelope.txt │ │ │ │ ├── savedEnvelope1.txt │ │ │ │ ├── savedEnvelope2D.txt │ │ │ │ ├── savedLinearUnit.txt │ │ │ │ ├── savedMultiPoint.txt │ │ │ │ ├── savedPolygon1.txt │ │ │ │ ├── savedPolyline.txt │ │ │ │ ├── savedPolyline1.txt │ │ │ │ ├── savedAngularUnit.txt │ │ │ │ ├── savedMultiPoint1.txt │ │ │ │ ├── savedSpatialReference.txt │ │ │ │ ├── savedProjectionTransformation.txt │ │ │ │ ├── failing-gigs │ │ │ │ ├── README.md │ │ │ │ ├── 5205.1.json │ │ │ │ ├── 5204.1.json │ │ │ │ ├── 5107.json │ │ │ │ ├── 5203.1.json │ │ │ │ ├── 5105.1.json │ │ │ │ ├── 5102.2.json │ │ │ │ ├── 5207.1.json │ │ │ │ └── 5101.4-jhs.json │ │ │ │ └── gigs │ │ │ │ ├── 5112.json │ │ │ │ ├── 5113.json │ │ │ │ ├── 5110.json │ │ │ │ ├── 5103.3.json │ │ │ │ ├── 5103.2.json │ │ │ │ ├── 5208.json │ │ │ │ ├── 5109.json │ │ │ │ ├── 5105.2.json │ │ │ │ ├── 5108.json │ │ │ │ ├── 5102.1.json │ │ │ │ ├── 5104.json │ │ │ │ ├── 5103.1.json │ │ │ │ ├── 5101.3-jhs.json │ │ │ │ ├── 5101.2-jhs.json │ │ │ │ └── 5106.json │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── epl │ │ │ └── geometry │ │ │ ├── ProtobufCursor.java │ │ │ ├── GeneralizeType.java │ │ │ ├── OperatorEnclosingCircleLocal.java │ │ │ ├── OperatorEnclosingCircle.java │ │ │ ├── OperatorRandomPoints.java │ │ │ ├── OperatorFactoryEx.java │ │ │ ├── OperatorRandomPointsLocal.java │ │ │ ├── OperatorEnclosingCircleCursor.java │ │ │ ├── SimpleByteBufferCursorEx.java │ │ │ ├── InverseResult.java │ │ │ ├── OperatorBufferExCursor.java │ │ │ ├── OperatorProjectCursor.java │ │ │ └── Point2DEx.java │ └── build.gradle │ ├── epl-geometry-service │ └── settings.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ ├── build.gradle │ ├── README.md │ └── Dockerfile ├── rust ├── src │ ├── proto │ │ └── mod.rs │ └── lib.rs ├── Cargo.toml └── build.rs ├── go.mod ├── README.md ├── cpp ├── test │ ├── helper.h │ └── CMakeLists.txt ├── CMakeLists.txt └── Dockerfile ├── docker ├── push.sh ├── generate.sh └── proj │ └── Dockerfile ├── dotnet ├── EplProtobuf │ └── EplProtobuf.csproj └── GeoGrpc.sln ├── proto └── generate.sh ├── copy_mono.sh └── golang └── epl └── protobuf └── v1 ├── query_x.go └── stac_x.go /VERSION: -------------------------------------------------------------------------------- 1 | 0.4.12 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.list 2 | -------------------------------------------------------------------------------- /python/epl_protobuf/VERSION: -------------------------------------------------------------------------------- 1 | 1.0.4 -------------------------------------------------------------------------------- /python/epl_geometry/test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/epl_protobuf/epl/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/epl_protobuf/epl/protobuf/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/epl_protobuf/requirements.txt: -------------------------------------------------------------------------------- 1 | grpcio-tools==1.33.2 2 | protobuf>=3.8.0 -------------------------------------------------------------------------------- /python/epl_geometry/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .idea 3 | 4 | **/*.pyc 5 | **/__pycache__/ -------------------------------------------------------------------------------- /python/epl_geometry/requirements-test.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-flake8 3 | numpy 4 | requests 5 | -------------------------------------------------------------------------------- /python/epl_protobuf/README.md: -------------------------------------------------------------------------------- 1 | protobuf and gRPC client/service files for geometry and STAC -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'epl-geometry-api' 2 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'epl-geometry-api-ex' 2 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-service/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'epl-geometry-service' 2 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/resources/com/esri/core/geometry/intermediate_to_old_wkid.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/epl_geometry/setup.cfg: -------------------------------------------------------------------------------- 1 | # content of setup.cfg 2 | [tool:pytest] 3 | flake8-max-line-length = 120 4 | -------------------------------------------------------------------------------- /python/epl_geometry/epl/__init__.py: -------------------------------------------------------------------------------- 1 | from pkgutil import extend_path 2 | __path__ = extend_path(__path__, __name__) 3 | -------------------------------------------------------------------------------- /java/geometry-chain/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /java/geometry-chain/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'geometry-chain' 2 | include 'epl-geometry-api' 3 | include 'epl-geometry-api-ex' 4 | include 'epl-geometry-service' 5 | -------------------------------------------------------------------------------- /python/epl_geometry/requirements.txt: -------------------------------------------------------------------------------- 1 | --index-url https://pypi.python.org/simple 2 | grpcio-tools==1.33.2 3 | protobuf>=3.8.0 4 | Shapely==1.6.4.post2 5 | pytest 6 | ../epl_protobuf/ 7 | -e . -------------------------------------------------------------------------------- /rust/src/proto/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod geometry; 2 | pub mod geometry_service; 3 | pub mod geometry_service_grpc; 4 | pub mod query; 5 | pub mod stac; 6 | pub mod stac_service; 7 | pub mod stac_service_grpc; 8 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPoint.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPoint.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPoint1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPoint1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolygon.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolygon.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedAreaUnit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedAreaUnit.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedEnvelope.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedEnvelope.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedEnvelope1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedEnvelope1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedEnvelope2D.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedEnvelope2D.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedLinearUnit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedLinearUnit.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedMultiPoint.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedMultiPoint.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolygon1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolygon1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolyline.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolyline.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolyline1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedPolyline1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPoint.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPoint.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPoint1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPoint1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolygon.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolygon.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedAngularUnit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedAngularUnit.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedMultiPoint1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedMultiPoint1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedAreaUnit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedAreaUnit.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedEnvelope.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedEnvelope.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedEnvelope1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedEnvelope1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolygon1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolygon1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolyline.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolyline.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolyline1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedPolyline1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedAngularUnit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedAngularUnit.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedEnvelope2D.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedEnvelope2D.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedLinearUnit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedLinearUnit.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedMultiPoint.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedMultiPoint.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedMultiPoint1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedMultiPoint1.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedSpatialReference.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedSpatialReference.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/resources/com/esri/core/geometry/pcs_tolerances.txt: -------------------------------------------------------------------------------- 1 | 0 6.66667e-009 2 | 1 2e-008 3 | 2 4.97098e-005 4 | 3 0.001 5 | 4 0.00109362 6 | 5 0.00328087 7 | 6 0.00497101 8 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedSpatialReference.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedSpatialReference.txt -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/geo-grpc/api 2 | 3 | require ( 4 | github.com/golang/protobuf v1.4.1 5 | github.com/twpayne/go-geom v1.3.6 6 | golang.org/x/net v0.0.0-20191003171128-d98b1b443823 7 | google.golang.org/grpc v1.27.0 8 | ) 9 | 10 | go 1.13 11 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedProjectionTransformation.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/savedProjectionTransformation.txt -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedProjectionTransformation.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geo-grpc/api/HEAD/java/geometry-chain/epl-geometry-api/src/test/resources/com/esri/core/geometry/savedProjectionTransformation.txt -------------------------------------------------------------------------------- /rust/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod proto; 2 | 3 | pub use proto::geometry::*; 4 | pub use proto::geometry_service::*; 5 | pub use proto::geometry_service_grpc::*; 6 | pub use proto::query::*; 7 | pub use proto::stac::*; 8 | pub use proto::stac_service::*; 9 | pub use proto::stac_service_grpc::*; 10 | -------------------------------------------------------------------------------- /java/geometry-chain/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 15 17:10:44 EDT 2020 2 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip 3 | distributionBase=GRADLE_USER_HOME 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # protobuf 2 | 3 | Proto files here are used in [STAC](https://github.com/nearspacelabs/stac-python-client) service and in [geometry service](https://github.com/geo-grpc/geometry-chain) 4 | 5 | Build new versions using `generate.sh` from proto directory (requires docker): 6 | ```bash 7 | ./generate.sh 8 | ``` 9 | -------------------------------------------------------------------------------- /cpp/test/helper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by David Raleigh on 1/18/21. 3 | // 4 | 5 | #ifndef CPP_HELPER_H 6 | #define CPP_HELPER_H 7 | 8 | #include 9 | 10 | struct MemoryStruct { 11 | char *memory; 12 | uint64_t size; 13 | }; 14 | 15 | char* get_nsl_access_token(); 16 | 17 | #endif //CPP_HELPER_H 18 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/failing-gigs/README.md: -------------------------------------------------------------------------------- 1 | The files in here are test data from gigs that Proj.4 admits are still failing 2 | 3 | https://github.com/OSGeo/proj.4/blob/7aebf01badc811d8db2586d0f5542281e9913390/test/gigs/TESTNOTES.md 4 | 5 | https://github.com/micahcochran/proj.4/blob/py-gigs/test/gigs/TESTNOTES.md -------------------------------------------------------------------------------- /python/epl_geometry/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7.7-buster 2 | 3 | RUN DEBIAN_FRONTEND=noninteractive apt-get update 4 | 5 | RUN mkdir -p /opt/src/epl_protobuf 6 | COPY ./epl_protobuf/ /opt/src/epl_protobuf 7 | 8 | WORKDIR /opt/src/epl_geometry 9 | COPY ./epl_geometry /opt/src/epl_geometry 10 | 11 | RUN pip install -r requirements.txt && \ 12 | python setup.py install 13 | -------------------------------------------------------------------------------- /docker/push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | COMMIT_SHA=$(git log -1 --format=%h) 4 | PREFIX=geogrpc/ 5 | TAG=buster-${COMMIT_SHA} 6 | if [[ $# -eq 0 ]] ; then 7 | echo tag "${TAG}" 8 | else 9 | TAG=${TAG}-$1 10 | echo tag "${TAG}" 11 | fi 12 | 13 | C_BUILDER=${PREFIX}c-builder:${TAG} 14 | PROJ=${PREFIX}proj:${TAG} 15 | GEOMETRY=${PREFIX}geometry-chain:${TAG} 16 | 17 | docker push "${C_BUILDER}" 18 | docker push "${PROJ}" 19 | docker push "${GEOMETRY}" 20 | -------------------------------------------------------------------------------- /java/geometry-chain/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | } 4 | 5 | group 'epl-geometry' 6 | version '1.0-SNAPSHOT' 7 | 8 | sourceCompatibility = 1.8 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | dependencies { 15 | testCompile group: 'junit', name: 'junit', version: '4.12' 16 | } 17 | 18 | //project(':epl-geometry-api-ex') { 19 | // dependencies { 20 | // implementation project(':epl-geometry-api') 21 | // } 22 | //} 23 | -------------------------------------------------------------------------------- /dotnet/EplProtobuf/EplProtobuf.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "stac-jrpc-api" 3 | version = "0.1.0" 4 | authors = ["sunny-g "] 5 | edition = "2018" 6 | build = "build.rs" 7 | 8 | [dependencies] 9 | grpcio = { version = "0.4", features = ["openssl"] } 10 | protobuf = { version = "2", features = ["with-serde"] } 11 | serde = "1.0" 12 | serde_derive = "1.0" 13 | 14 | [build-dependencies] 15 | lazy_static = "1.4" 16 | protobuf-codegen = { version = "2" } 17 | protoc-grpcio = "1.1" 18 | -------------------------------------------------------------------------------- /java/geometry-chain/README.md: -------------------------------------------------------------------------------- 1 | # geometry-chain 2 | Geometry library with Projection and Geodetic methods inheriting from an [altered version](https://github.com/davidraleigh/geometry-api-java/tree/epl) of the ESRI geometry-api-java. 3 | 4 | ## Dependencies and Requirements 5 | - JDK of 9+ 6 | - 5.2 Proj lib with JNI 7 | 8 | ## Building 9 | Your jni `proj.jar` file for Proj 5.2 must be located in `/usr/local/lib/proj.jar` or you'll need to update that in your build.gradle file. 10 | ```bash 11 | ./gradlew build install 12 | ``` 13 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/StringCursor.java: -------------------------------------------------------------------------------- 1 | package com.esri.core.geometry; 2 | 3 | import java.util.Iterator; 4 | 5 | public abstract class StringCursor implements Iterator { 6 | public abstract String next(); 7 | 8 | public abstract int getID(); 9 | 10 | public abstract String getFeatureID(); 11 | 12 | public abstract SimpleStateEnum getSimpleState(); 13 | 14 | public abstract Envelope2D getEnvelope2D(); 15 | 16 | public abstract boolean hasNext(); 17 | } 18 | -------------------------------------------------------------------------------- /python/epl_geometry/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | geometry-client: 4 | container_name: geometry-client-c 5 | image: geometry-client-i 6 | build: 7 | context: . 8 | dockerfile: Dockerfile 9 | depends_on: 10 | - geometry-chain 11 | networks: 12 | - geometry-service 13 | environment: 14 | - GEOMETRY_SERVICE_HOST=geometry-chain:8980 15 | 16 | geometry-chain: 17 | container_name: geometry-chain-c 18 | image: geogrpc/geometry-chain:latest 19 | ports: 20 | - "8980:8980" 21 | networks: 22 | - geometry-service 23 | 24 | networks: 25 | geometry-service: {} 26 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5112.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[51.0, 42.0], [0.0, 3819897.85]], 4 | [[51.0, 0.0], [0.0, 0.0]], 5 | [[57.0, 0.0], [497112.88, 0.0]], 6 | [[54.0, 20.5], [248556.44, 1724781.5]], 7 | [[67.0, -41.0], [1325634.35, -3709687.25]] 8 | ], 9 | "description": "Test 5112, Mercator (variant B), v2-0_2011-06-28.", 10 | "projections": ["+init=epsg:4284", "+init=epsg:3388"], 11 | "tests": [ 12 | {"tolerances": [5.555555555555555e-07, 0.05], "type": "conversion"}, 13 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /docker/generate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | JAVA_VERSION=11.0.10 5 | COMMIT_SHA=$(git log -1 --format=%h) 6 | PREFIX=geogrpc/ 7 | TAG=buster-${COMMIT_SHA} 8 | if [[ $# -eq 0 ]] ; then 9 | echo tag "${TAG}" 10 | else 11 | TAG=${TAG}-$1 12 | echo tag "${TAG}" 13 | fi 14 | 15 | C_BUILDER=${PREFIX}c-builder:${TAG} 16 | PROJ=${PREFIX}proj:${TAG} 17 | GEOMETRY=${PREFIX}geometry-chain:${TAG} 18 | 19 | docker build --build-arg JAVA_VERSION="${JAVA_VERSION}" -t "${C_BUILDER}" -f ./c-builder/Dockerfile . 20 | docker build --build-arg TAG="${TAG}" -t "${PROJ}" -f ./proj/Dockerfile . 21 | cd ../java/geometry-chain 22 | docker build --build-arg JAVA_VERSION="${JAVA_VERSION}" --build-arg TAG="${TAG}" -t "${GEOMETRY}" . 23 | cd ../../docker -------------------------------------------------------------------------------- /proto/generate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ### protoc.sh 4 | docker run --rm -it -v "${GOPATH}":/defs --entrypoint /bin/sh namely/protoc:1.28_2 -c "/defs/src/github.com/geo-grpc/api/proto/protoc.sh" 5 | ### protoc.sh 6 | 7 | # copy geometry over to java 8 | cp -r "$(pwd)"/epl/protobuf/v1/geometry*.proto "$(pwd)"/../java/geometry-chain/epl-geometry-service/src/main/proto/epl/protobuf/v1 9 | # copy geometry over to java 10 | 11 | docker run --rm -v "$(pwd)/.."/docs:/out -v "$(pwd)":/protos pseudomuto/protoc-gen-doc:1.3.1 \ 12 | --proto_path=/protos/ \ 13 | epl/protobuf/v1/geometry.proto \ 14 | epl/protobuf/v1/geometry_service.proto \ 15 | epl/protobuf/v1/query.proto \ 16 | epl/protobuf/v1/stac.proto \ 17 | epl/protobuf/v1/stac_service.proto -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5113.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Test 5113, Transverse Mercator (South Oriented), v2-0_2011-06-28.", 3 | "coordinates": [ [[22.5, 0.0], [-166998.44, 0.0]], 4 | [[21.5, -25.0], [-50475.46, 2766147.25]], 5 | [[20.5, -30.0], [48243.45, 3320218.65]], 6 | [[19.5, -35.0], [136937.65, 3875621.18]], 7 | [[19.5, -35.0], [136937.65, 3875621.18]] 8 | ], 9 | "projections": ["+init=epsg:4148", "+init=epsg:2049"], 10 | "tests": [{"tolerances": [2.7777777777777776e-07, 0.03], "type": "conversion"}, 11 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"}] 12 | } 13 | -------------------------------------------------------------------------------- /copy_mono.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copy JAVA from mono 4 | cp -r ../../nearspacelabs/mono/java/geometry-chain/epl-geometry-api/src ./java/geometry-chain/epl-geometry-api 5 | cp -r ../../nearspacelabs/mono/java/geometry-chain/epl-geometry-api-ex/src ./java/geometry-chain/epl-geometry-api-ex 6 | cp -r ../../nearspacelabs/mono/java/geometry-chain/epl-geometry-service/src ./java/geometry-chain/epl-geometry-service 7 | cp ../../nearspacelabs/mono/java/geometry-chain/build.gradle ./java/geometry-chain/ 8 | cp ../../nearspacelabs/mono/java/geometry-chain/settings.gradle ./java/geometry-chain/ 9 | # Copy JAVA from mono 10 | 11 | # Copy Python from mono 12 | cp -r ../../nearspacelabs/mono/python/epl_geometry ./python 13 | cp -r ../../nearspacelabs/mono/python/epl_protobuf ./python 14 | # Copy Python from mono -------------------------------------------------------------------------------- /rust/build.rs: -------------------------------------------------------------------------------- 1 | extern crate protoc_grpcio; 2 | 3 | use protobuf_codegen::Customize; 4 | 5 | fn main() { 6 | let proto_lib_root = "src/proto"; 7 | let proto_root = "../proto"; 8 | let proto_files = [ 9 | "epl/protobuf/geometry.proto", 10 | "epl/protobuf/query.proto", 11 | "epl/protobuf/stac.proto", 12 | "epl/protobuf/geometry_service.proto", 13 | "epl/protobuf/stac_service.proto", 14 | ]; 15 | println!("cargo:rerun-if-changed={}", proto_root); 16 | 17 | protoc_grpcio::compile_grpc_protos( 18 | &proto_files, 19 | &[proto_root], 20 | &proto_lib_root, 21 | Some(Customize { 22 | serde_derive: Some(true), 23 | ..Default::default() 24 | }), 25 | ) 26 | .expect("Failed to compile gRPC definitions!"); 27 | } 28 | -------------------------------------------------------------------------------- /dotnet/GeoGrpc.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EplProtobuf", "EplProtobuf\EplProtobuf.csproj", "{263AE204-F811-4710-8EB9-B93D452E029A}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Release|Any CPU = Release|Any CPU 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {263AE204-F811-4710-8EB9-B93D452E029A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 | {263AE204-F811-4710-8EB9-B93D452E029A}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 | {263AE204-F811-4710-8EB9-B93D452E029A}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | {263AE204-F811-4710-8EB9-B93D452E029A}.Release|Any CPU.Build.0 = Release|Any CPU 15 | EndGlobalSection 16 | EndGlobal 17 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5110.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[5, 70], [4127824.65822105, 5214090.649]], 4 | [[5, 60], [4041548.13, 4109791.66]], 5 | [[5, 50], [3962799.45, 2999718.853]], 6 | [[5, 40], [3892127.02, 1892578.962]], 7 | [[5, 30], [3830117.9, 796781.677]], 8 | [[10, 52], [4321000.0, 3210000.0]], [[0.0, 50.0], [3606514.43, 3036305.967]], [[3.0, 50.0], [3819948.288, 3011432.894]], [[5.0, 50.0], [3962799.451, 2999718.853]], [[8.0, 50.0], [4177612.521, 2989464.315]], [[10.0, 50.0], [4321000.0, 2987510.567]]], "description": "Test 5110, Lambert Azimuthal Equal Area, v2-0_2011-06-28.", 9 | "projections": ["+init=epsg:4258", "+init=epsg:3035"], 10 | "tests": [{"tolerances": [5.555555555555555e-07, 0.05], "type": "conversion"}, 11 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"}] 12 | } 13 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5103.3.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[-110, 49], [2003933.27, 6452478.8]], 4 | [[-110, 47], [2016617.9, 5717717.18]], 5 | [[-110, 45], [2029251.51, 4985910.59]], 6 | [[-110, 43], [2041851.0, 4256081.23]], 7 | [[-110, 41], [2054432.46, 3527295.67]], 8 | [[-110, 41], [2054432.46, 3527295.67]], 9 | [[-108, 41], [2606240.3, 3543175.46]], 10 | [[-106, 41], [3157536.54, 3571750.25]], 11 | [[-104, 41], [3708029.16, 3613004.9]], 12 | [[-102, 41], [4257426.54, 3666917.56]] 13 | ], 14 | "description": "Test 5103 (part 3), Lambert Conic Conformal (2SP), v2-0_2011-06-28.", 15 | "projections": ["+init=epsg:4152", "+init=epsg:3568"], 16 | "tests": [ 17 | {"tolerances": [2.7777777777777776e-07, 0.03], "type": "conversion"}, 18 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5103.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[-110, 49], [2003937.27, 6452491.7]], 4 | [[-110, 47], [2016621.93, 5717728.61]], 5 | [[-110, 45], [2029255.57, 4985920.56]], 6 | [[-110, 43], [2041855.08, 4256089.74]], 7 | [[-110, 41], [2054436.57, 3527302.73]], 8 | [[-110, 41], [2054436.57, 3527302.73]], 9 | [[-108, 41], [2606245.52, 3543182.55]], 10 | [[-106, 41], [3157542.86, 3571757.39]], 11 | [[-104, 41], [3708036.57, 3613012.12]], 12 | [[-102, 41], [4257435.06, 3666924.89]] 13 | ], 14 | "description": "Test 5103 (part 2), Lambert Conic Conformal (2SP), v2-0_2011-06-28.", 15 | "projections": ["+init=epsg:4152", "+init=epsg:2921"], 16 | 17 | "tests": [ 18 | {"tolerances": [2.7777777777777776e-07, 0.03], "type": "conversion"}, 19 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/ProtobufCursor.java: -------------------------------------------------------------------------------- 1 | //package org.epl.geometry; 2 | // 3 | //import org.epl.protobuf.GeometryResponse; 4 | //import org.epl.protobuf.GeometryRequest; 5 | // 6 | //import java.util.ArrayDeque; 7 | //import java.util.Iterator; 8 | // 9 | //public class ProtobufCursor implements Iterator { 10 | // 11 | // private ArrayDeque m_geometryRequest; 12 | // 13 | // public ProtobufCursor() { 14 | // m_geometryRequest = new ArrayDeque<>(); 15 | // } 16 | // 17 | // @Override 18 | // public boolean hasNext() { 19 | // return m_geometryRequest != null && !m_geometryRequest.isEmpty(); 20 | // } 21 | // 22 | // @Override 23 | // public GeometryResponse next() { 24 | // return GeometryResponse.newBuilder().setGeometry(m_geometryRequest.pop().getGeometry()).build(); 25 | // } 26 | // 27 | // public void tick(GeometryRequest geometryRequest) { 28 | // m_geometryRequest.push(geometryRequest); 29 | // } 30 | //} 31 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/GeneralizeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017-2020 Echo Park Labs 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | 18 | email: davidraleigh@gmail.com 19 | */ 20 | 21 | package org.epl.geometry; 22 | 23 | /** 24 | * Created by davidraleigh on 4/17/16. 25 | */ 26 | public enum GeneralizeType { 27 | ResultContainsOriginal, 28 | ResultWithinOriginal, 29 | Neither 30 | } 31 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5208.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Test 5208, Longitude Rotation, v2.0_2011-06-28.", 3 | "projections" : [ "+init=epsg:4275", "+init=epsg:4807" ], 4 | 5 | "coordinates": [ 6 | [ [5, 58], [2.66277083, 58] ], 7 | [ [5, 56], [2.66277083, 56] ], 8 | [ [5, 55], [2.66277083, 55] ], 9 | [ [5, 53], [2.66277083, 53] ], 10 | [ [4, 51], [1.66277083, 51] ], 11 | [ [4, 49], [1.66277083, 49] ], 12 | [ [2.33722917, 46.8], [0, 46.8] ], 13 | [ [3, 53], [0.66277083, 53] ], 14 | [ [4, 53], [1.66277083, 53] ], 15 | [ [6, 53], [3.66277083, 53] ], 16 | [ [7, 53], [4.66277083, 53] ], 17 | [ [9, 53], [6.66277083, 53] ], 18 | [ [10, 53], [7.66277083, 53] ], 19 | [ [11, 53], [8.66277083, 53] ] 20 | ], 21 | 22 | "tests" : [ {"type": "conversion", "tolerances": [2.7777777777777776e-07, 2.7777777777777776e-07]}, 23 | {"type": "roundtrip", "times":1000, "tolerances": [5.555555555555556e-08, 5.555555555555556e-08] } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /cpp/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # https://github.com/dmonopoly/gtest-cmake-example/blob/master/CMakeLists.txt 2 | # http://www.kaizou.org/2014/11/gtest-cmake/ 3 | # https://stackoverflow.com/questions/8507723/how-to-start-working-with-gtest-and-cmake 4 | cmake_minimum_required(VERSION 3.7) 5 | 6 | # Cmake find modules 7 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") 8 | 9 | find_package(Protobuf REQUIRED) 10 | find_package(GRPC REQUIRED) 11 | FIND_PACKAGE(CURL) 12 | 13 | project(unitTest C CXX) 14 | find_package(GTest REQUIRED) 15 | 16 | include_directories(${GTEST_INCLUDE_DIRS} 17 | ${protobuf_lib_INCLUDE} 18 | ${CMAKE_SOURCE_DIR}/protobuf-lib 19 | ./helper.h) 20 | 21 | set(SOURCE_FILES ./helper.cpp ./main.cpp) 22 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") 23 | 24 | add_executable(unitTest ${SOURCE_FILES}) 25 | 26 | 27 | target_link_libraries(unitTest 28 | ${GTEST_BOTH_LIBRARIES} 29 | ${CMAKE_THREAD_LIBS_INIT} 30 | ${JWT_LIBS} 31 | protobuf_lib 32 | curl) 33 | 34 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/OperatorEnclosingCircleLocal.java: -------------------------------------------------------------------------------- 1 | package org.epl.geometry; 2 | 3 | import com.esri.core.geometry.Geometry; 4 | import com.esri.core.geometry.GeometryCursor; 5 | import com.esri.core.geometry.ProgressTracker; 6 | import com.esri.core.geometry.SimpleGeometryCursor; 7 | 8 | public class OperatorEnclosingCircleLocal extends OperatorEnclosingCircle { 9 | @Override 10 | public GeometryCursor execute(GeometryCursor geoms, SpatialReferenceEx spatialReference, ProgressTracker progressTracker) { 11 | return new OperatorEnclosingCircleCursor(geoms, spatialReference, progressTracker); 12 | } 13 | 14 | @Override 15 | public Geometry execute(Geometry geom, SpatialReferenceEx spatialReference, ProgressTracker progressTracker) { 16 | OperatorEnclosingCircleCursor operatorEnclosingCircleCursor = new OperatorEnclosingCircleCursor(new SimpleGeometryCursor(geom), spatialReference, progressTracker); 17 | return operatorEnclosingCircleCursor.next(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5109.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[132, 0], [0, 0]], 4 | [[132, -27], [0, -2926820.89]], 5 | [[140, 0], [966973.98, -30285.6]], 6 | [[140, -20], [832799.36, -2170181.93]], 7 | [[140, -40], [693250.21, -4395794.49]], 8 | [[140, -60], [567313.29, -6404311.16]], 9 | [[140, -80], [486878.674, -7687130.029]], 10 | [[120, -60], [-850274.75, -6426505.13]], 11 | [[130, -60], [-141915.26, -6387653.78]], 12 | [[140, -60], [567313.29, -6404311.16]], 13 | [[150, -60], [1273067.747, -6476375.276]], 14 | [[160, -60], [1971026.26, -6603404.82]], 15 | [[170, -60], [2656914.716, -6784621.89]] 16 | ], 17 | "description": "Test 5109, Albers Equal Area, v2-0_2011-06-28.", 18 | "projections": ["+init=epsg:4283", "+init=epsg:3577"], 19 | "tests": [ 20 | {"tolerances": [5.555555555555555e-07, 0.05], "type": "conversion"}, 21 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ProjectionTransformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | //This is a stub 28 | class ProjectionTransformation { 29 | } 30 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/OperatorEnclosingCircle.java: -------------------------------------------------------------------------------- 1 | package org.epl.geometry; 2 | 3 | import com.esri.core.geometry.Geometry; 4 | import com.esri.core.geometry.GeometryCursor; 5 | import com.esri.core.geometry.ProgressTracker; 6 | 7 | public abstract class OperatorEnclosingCircle extends OperatorEx { 8 | @Override 9 | public Type getType() { 10 | return Type.EnclosingCircle; 11 | } 12 | 13 | 14 | public abstract GeometryCursor execute(GeometryCursor geoms, SpatialReferenceEx spatialReference, ProgressTracker progressTracker); 15 | 16 | /** 17 | * Performs the Generalize operation on a single geometry. Point and 18 | * multipoint geometries are left unchanged. An envelope is converted to a 19 | * polygon. 20 | */ 21 | public abstract Geometry execute(Geometry geom, SpatialReferenceEx spatialReference, ProgressTracker progressTracker); 22 | 23 | public static OperatorEnclosingCircle local() { 24 | return (OperatorEnclosingCircle) OperatorFactoryLocalEx.getInstance().getOperator(Type.EnclosingCircle); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/MapOGCStructure.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | public class MapOGCStructure { 27 | public OGCStructure m_ogcStructure; 28 | public SpatialReference m_spatialReference; 29 | } 30 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/WkbByteOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | interface WkbByteOrder { 28 | public static final int wkbXDR = 0; // Big Endian 29 | public static final int wkbNDR = 1; // Little Endian 30 | } 31 | -------------------------------------------------------------------------------- /python/epl_protobuf/setup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | from setuptools import setup, find_packages 5 | 6 | src_path = os.path.dirname(os.path.abspath(sys.argv[0])) 7 | old_path = os.getcwd() 8 | os.chdir(src_path) 9 | sys.path.insert(0, src_path) 10 | 11 | kwargs = { 12 | 'name': 'epl.protobuf.v1', 13 | 'description': 'generated protobufs for geometry and STAC', 14 | 'url': 'https://github.com/geo-grpc/api', 15 | 'long_description': 'https://github.com/geo-grpc/api', 16 | 'author': 'David Raleigh', 17 | 'author_email': 'davidraleigh@gmail.com', 18 | 'license': 'Apache 2.0', 19 | 'version': '1.0.4', 20 | 'namespace_package': ['epl'], 21 | 'python_requires': '>3.5.2', 22 | 'packages': ['epl.protobuf.v1'], 23 | 'install_requires': [ 24 | 'grpcio-tools', 25 | 'protobuf' 26 | ], 27 | 'zip_safe': False 28 | } 29 | 30 | clssfrs = [ 31 | 'Programming Language :: Python', 32 | 'Programming Language :: Python :: 3', 33 | 'Programming Language :: Python :: 3.5', 34 | 'Programming Language :: Python :: 3.6', 35 | ] 36 | kwargs['classifiers'] = clssfrs 37 | 38 | setup(**kwargs) 39 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OGCStructure.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | import java.util.List; 27 | 28 | public class OGCStructure { 29 | public int m_type; 30 | public List m_structures; 31 | public Geometry m_geometry; 32 | } 33 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/PeDouble.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | public final class PeDouble { 28 | public double val; 29 | 30 | public PeDouble() { 31 | val = 0.0; 32 | } 33 | 34 | public PeDouble(double v) { 35 | val = v; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/UserCancelException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | class UserCancelException extends GeometryException { 27 | private static final long serialVersionUID = 1L; 28 | 29 | public UserCancelException() { 30 | super("user cancel"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/OperatorRandomPoints.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by davidraleigh on 5/10/17. 3 | */ 4 | 5 | package org.epl.geometry; 6 | 7 | import com.esri.core.geometry.Geometry; 8 | import com.esri.core.geometry.GeometryCursor; 9 | import com.esri.core.geometry.ProgressTracker; 10 | 11 | public abstract class OperatorRandomPoints extends OperatorEx { 12 | @Override 13 | public OperatorEx.Type getType() { 14 | return Type.RandomPoints; 15 | } 16 | 17 | public abstract GeometryCursor execute( 18 | GeometryCursor inputPolygons, 19 | double[] pointsPerSquareKm, 20 | long seed, 21 | SpatialReferenceEx sr, 22 | ProgressTracker progressTracker); 23 | 24 | public abstract Geometry execute( 25 | Geometry inputPolygon, 26 | double pointsPerSquareKm, 27 | long seed, 28 | SpatialReferenceEx sr, 29 | ProgressTracker progressTracker); 30 | 31 | public static OperatorRandomPoints local() { 32 | return (OperatorRandomPoints) OperatorFactoryLocalEx.getInstance().getOperator(Type.RandomPoints); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5105.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[16, 48.5], [424714.235, 355124.6]], 4 | [[17.2, 48.0], [512056.188, 296756.716]], 5 | [[17.582650555556, 47.636134722222], [539847.765, 255701.086]], 6 | [[19.048571666667, 47.144393611111], [650000, 200000]], 7 | [[19.223429444445, 46.875668333333], [663329.053, 170142.318]], 8 | [[20.135740555556, 46.370301111111], [733651.455, 114532.099]], 9 | [[21.4, 45.7], [833148.855, 42191.482]], 10 | [[22.3, 49.3], [886565.935, 444656.613]], 11 | [[21.294198611111, 48.489974722222], [815999.993, 351999.998]], 12 | [[19.223429444445, 46.875668333333], [663329.053, 170142.318]], 13 | [[17.619153611111, 46.068746388889], [539403.958, 81440.103]], 14 | [[16.36, 45.5], [439836.709, 20816.456]] 15 | ], 16 | 17 | "description": "Test 5105 (part 2), Oblique Mercator (variant B), v2-0_2011-06-28.", 18 | "projections": ["+init=epsg:4237", "+init=epsg:23700"], 19 | "tests": [ 20 | {"tolerances": [5.555555555555555e-07, 0.05], "type": "conversion"}, 21 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /golang/epl/protobuf/v1/query_x.go: -------------------------------------------------------------------------------- 1 | package v1 2 | //oneof ugly: https://github.com/golang/protobuf/issues/283 3 | import "github.com/golang/protobuf/ptypes/timestamp" 4 | 5 | func (m *FloatFilter) SetValue(value float32) { 6 | m.Data = &FloatFilter_Value{Value: value} 7 | } 8 | 9 | func (m *DoubleFilter) SetValue(value float64) { 10 | m.Data = &DoubleFilter_Value{Value: value} 11 | } 12 | 13 | func (m *UInt32Filter) SetValue(value uint32) { 14 | m.Data = &UInt32Filter_Value{Value: value} 15 | } 16 | 17 | func (m *TimestampFilter) SetValue(value *timestamp.Timestamp) { 18 | m.Data = &TimestampFilter_Value{Value:value} 19 | } 20 | 21 | 22 | func (m *FloatFilter) SetStartStop(start float32, end float32) { 23 | m.Data = &FloatFilter_Start{Start: start} 24 | m.End = end 25 | } 26 | 27 | func (m *UInt32Filter) SetStartStop(start uint32, end uint32) { 28 | m.Data = &UInt32Filter_Start{Start: start} 29 | m.End = end 30 | } 31 | 32 | func (m *DoubleFilter) SetStart(start float64, end float64) { 33 | m.Data = &DoubleFilter_Start{Start: start} 34 | m.End = end 35 | } 36 | 37 | func (m *TimestampFilter) SetStart(start *timestamp.Timestamp, end *timestamp.Timestamp) { 38 | m.Data = &TimestampFilter_Start{Start: start} 39 | m.End = end 40 | } -------------------------------------------------------------------------------- /python/epl_geometry/setup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | from setuptools import setup, find_packages 5 | 6 | src_path = os.path.dirname(os.path.abspath(sys.argv[0])) 7 | old_path = os.getcwd() 8 | os.chdir(src_path) 9 | sys.path.insert(0, src_path) 10 | 11 | kwargs = { 12 | 'name': 'epl.geometry', 13 | 'description': 'geometry library for gRPC remote geometry functions', 14 | 'url': 'https://github.com/geo-grpc/geometry-client-python', 15 | 'long_description': "geometry library for gRPC remote geometry functions", 16 | 'author': 'David Raleigh', 17 | 'author_email': 'davidraleigh@gmail.com', 18 | 'license': 'Apache 2.0', 19 | 'version': '1.1.0', 20 | 'namespace_package': ['epl'], 21 | 'python_requires': '>3.5.2', 22 | 'packages': ['epl.geometry'], 23 | 'install_requires': [ 24 | 'grpcio-tools', 25 | 'protobuf', 26 | 'shapely', 27 | 'epl.protobuf.v1' 28 | ], 29 | 'zip_safe': False 30 | } 31 | 32 | clssfrs = [ 33 | 'Programming Language :: Python', 34 | 'Programming Language :: Python :: 3', 35 | 'Programming Language :: Python :: 3.5', 36 | 'Programming Language :: Python :: 3.6', 37 | ] 38 | kwargs['classifiers'] = clssfrs 39 | 40 | setup(**kwargs) 41 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5108.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[106, 10], [267186.017, 881108.902]], 4 | [[106, 9], [268006.024, 770398.186]], 5 | [[106, 8], [268740.351, 659692.254]], 6 | [[106, 7], [269388.786, 548990.588]], 7 | [[106, 6], [269951.141, 438292.666]], 8 | [[106, 5], [270427.255, 327597.962]], 9 | [[106, 4], [270816.99, 216905.945]], 10 | [[106, 3], [271120.234, 106216.081]], 11 | [[103.561065778024, 2.04246768119792], [0, 0]], 12 | [[103.640259839629, 1.8277648438075], [8813.252, -23740.095]], 13 | [[106, 1], [271466.923, -115159.332]], 14 | [[109, 5], [603116.703, 329668.599]], 15 | [[108, 5], [492221.308, 328807.336]], 16 | [[107, 5], [381324.74, 328117.472]], 17 | [[106, 5], [270427.255, 327597.962]], 18 | [[105, 5], [159529.111, 327248.012]], 19 | [[104, 5], [48630.563, 327067.097]] 20 | ], 21 | 22 | "description": "Test 5108, Cassini-Soldner, v2-0_2011-06-28.", 23 | "projections": ["+init=epsg:4742", "+init=epsg:3377"], 24 | "tests": [{"tolerances": [5.555555555555555e-07, 0.05], "type": "conversion"}, 25 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"}] 26 | } 27 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/Interop.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | class Interop { 28 | public static double translateFromAVNaN(double n) { 29 | return (n < -1.0e38) ? NumberUtils.NaN() : n; 30 | } 31 | 32 | public static double translateToAVNaN(double n) { 33 | return (NumberUtils.isNaN(n)) ? -Double.MAX_VALUE : n; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ogc/OGCMultiSurface.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry.ogc; 26 | 27 | public abstract class OGCMultiSurface extends OGCGeometryCollection { 28 | public double area() { 29 | return getEsriGeometry().calculateArea2D(); 30 | } 31 | 32 | public OGCPoint pointOnSurface() { 33 | // TODO 34 | throw new UnsupportedOperationException(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/failing-gigs/5205.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "description" : "GIGS Test 5205 (Part 1), Molodensky-Badekas 10-parameter transformation, v2.0_2011-06-28. Geographic 2D domain (EPSG method code 9636)", 3 | "projections" : [ "+init=epsg:4289", "+init=epsg:4326" ], 4 | 5 | "coordinates": [ 6 | [ [150.01814371, 79.99494639], [150, 80] ], 7 | [ [120, 60], [119.99001559, 60.00441792] ], 8 | [ [60.00535007, 29.99746103], [60, 30] ], 9 | [ [0, 0], [-0.00007025, 0.0041133] ], 10 | [ [-60.00473241, -30.0042486], [-60, -30] ], 11 | [ [-120, -60], [-119.9922412, -60.00081456] ], 12 | [ [-150.01209192, -79.99612229], [-150, -80] ], 13 | [ [-180, 70], [179.99786174, 70.00666951] ], 14 | [ [-135.00454845, 49.99357566], [-135, 50] ], 15 | [ [-90, 25], [-89.99487454, 25.00457271] ], 16 | [ [0.00007032, -0.00411349], [0, 0] ], 17 | [ [143.9279419, -37.6532236], [143.92330599, -37.65282034] ], 18 | [ [135.00641074, -49.99958243], [135, -50] ], 19 | [ [180, -70], [179.99847886, -70.00362084] ] 20 | ], 21 | 22 | "tests" : [ {"type": "conversion", "tolerances": [2.7777777777777776e-07, 2.7777777777777776e-07]}, 23 | {"type": "roundtrip", "times":1000, "tolerances": [5.555555555555556e-08, 5.555555555555556e-08] } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ClassicSort.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | /* 25 | * To change this template, choose Tools | Templates 26 | * and open the template in the editor. 27 | */ 28 | package com.esri.core.geometry; 29 | 30 | abstract class ClassicSort { 31 | public abstract void userSort(int begin, int end, 32 | AttributeStreamOfInt32 indices); 33 | 34 | public abstract double getValue(int index); 35 | } 36 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorImportFromWktCursor.java: -------------------------------------------------------------------------------- 1 | package com.esri.core.geometry; 2 | 3 | public class OperatorImportFromWktCursor extends GeometryCursor { 4 | private StringCursor m_wktStringCursor; 5 | private int m_importFlags; 6 | 7 | public OperatorImportFromWktCursor(int import_flags, StringCursor stringCursor) { 8 | if (stringCursor == null) 9 | throw new GeometryException("invalid argument"); 10 | 11 | m_importFlags = import_flags; 12 | m_wktStringCursor = stringCursor; 13 | } 14 | 15 | @Override 16 | public boolean hasNext() { 17 | return m_wktStringCursor != null && m_wktStringCursor.hasNext(); 18 | } 19 | 20 | @Override 21 | public Geometry next() { 22 | if (hasNext()) { 23 | return OperatorImportFromWkt.local().execute( 24 | m_importFlags, 25 | Geometry.Type.Unknown, 26 | m_wktStringCursor.next(), 27 | null); 28 | } 29 | return null; 30 | } 31 | 32 | @Override 33 | public int getGeometryID() { 34 | return m_wktStringCursor.getID(); 35 | } 36 | 37 | @Override 38 | public SimpleStateEnum getSimpleState() { 39 | return m_wktStringCursor.getSimpleState(); 40 | } 41 | 42 | @Override 43 | public String getFeatureID() { 44 | return m_wktStringCursor.getFeatureID(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /golang/epl/protobuf/v1/stac_x.go: -------------------------------------------------------------------------------- 1 | package v1 2 | 3 | import "github.com/golang/protobuf/ptypes/timestamp" 4 | 5 | //oneof ugly: https://github.com/golang/protobuf/issues/283 6 | func (m *StacRequest) SetObserved(timestampFilter *TimestampFilter) { 7 | m.Temporal = &StacRequest_Observed{Observed: timestampFilter} 8 | } 9 | 10 | func (m *StacRequest) SetDatetime(timestampFilter *TimestampFilter) { 11 | m.Temporal = &StacRequest_Datetime{Datetime: timestampFilter} 12 | } 13 | 14 | func (m *StacRequest) SetIntersects(geometry *GeometryData) { 15 | m.Spatial = &StacRequest_Intersects{Intersects:geometry} 16 | } 17 | 18 | func (m *StacRequest) SetBbox(geometry *EnvelopeData) { 19 | m.Spatial = &StacRequest_Bbox{Bbox:geometry} 20 | } 21 | 22 | func (m *StacRequest) SetGeometryRequest(geometry *GeometryRequest) { 23 | m.Spatial = &StacRequest_GeometryRequest{GeometryRequest:geometry} 24 | } 25 | 26 | 27 | func (m *StacItem) SetGeometry(geometry *GeometryData) { 28 | m.Geometry = geometry 29 | m.Bbox = geometry.Envelope 30 | } 31 | 32 | func (m *StacItem) SetObserved(dt *timestamp.Timestamp) { 33 | m.Temporal = &StacItem_Observed{Observed:dt} 34 | m.TemporalDeprecated = &StacItem_Datetime{Datetime:dt} 35 | } 36 | 37 | func (m *StacItem) SetDatetime(dt *timestamp.Timestamp) { 38 | m.SetObserved(dt) 39 | } 40 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorGeodeticLengthLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | //This is a stub 28 | class OperatorGeodeticLengthLocal extends OperatorGeodeticLength { 29 | @Override 30 | public double execute(Geometry geom, SpatialReference sr, 31 | int geodeticCurveType, ProgressTracker progressTracker) { 32 | throw new GeometryException("not implemented"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/SimpleStateEnum.java: -------------------------------------------------------------------------------- 1 | package com.esri.core.geometry; 2 | 3 | public enum SimpleStateEnum { 4 | // on creation, after projection and after generalization a geometry has state simple unknown (not know if simple or not) 5 | SIMPLE_UNKNOWN, 6 | // weak simple (no self intersections, ring orientation is correct, but ring order is not) 7 | WEAK_SIMPLE, 8 | // same as weak simple + OGC ring order. 9 | STRONG_SIMPLE, 10 | // is_simple method has been run on the geometry and it is known to be non-simple, but the reason is unknown 11 | NON_SIMPLE, 12 | // non-simple, because the structure is bad (0 size path, for example). 13 | STRUCTURE_FLAW, 14 | // Non-simple, because there are degenerate segments. 15 | DEGENERATE_SEGMENTS, 16 | // Non-simple, because not clustered properly, that is there are non-coincident vertices closer than tolerance. 17 | CLUSTERING, 18 | // Non-simple, because not cracked properly (intersecting segments, overlaping segments) 19 | CRACKING, 20 | // Non-simple, because there are crossovers (self intersections that are not cracking case). 21 | CROSS_OVER, 22 | // Non-simple, because holes or exteriors have wrong orientation. 23 | RING_ORIENTATION, 24 | } 25 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/WktImportFlags.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | /** 27 | *Flags used by the OperatorImportFromWkt. 28 | */ 29 | public interface WktImportFlags { 30 | public static final int wktImportDefaults = 0;//! { 30 | 31 | public int compare(Proximity2DResult v1, Proximity2DResult v2) { 32 | if (v1.m_distance < v2.m_distance) 33 | return -1; 34 | if (v1.m_distance == v2.m_distance) 35 | return 0; 36 | 37 | return 1; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5104.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[5, 58], [132023.27, 1114054.87]], 4 | [[5, 57], [131405.466, 1002468.081]], 5 | [[5, 56], [130792.264, 890981.281]], 6 | [[5, 55], [130183.56, 779577.7]], 7 | [[5, 54], [129579.26, 668240.58]], 8 | [[5, 53], [128979.26, 556953.19]], 9 | [[5.38763888888889, 52.1561605555556], [155000, 463000]], 10 | [[4, 51], [57605.946, 335312.662]], 11 | [[4, 50], [55502.306, 224086.514]], 12 | [[4.0, 49.0], [53412.76, 112842.73]], 13 | [[3.31372805555556, 47.9752611111111], [0, 0]], 14 | [[3, 53], [-5253.06, 559535.55]], 15 | [[4, 53], [61856.78, 557779.12]], 16 | [[5, 53], [128979.26, 556953.19]], 17 | [[6, 53], [196105.28, 557057.74]], 18 | [[7, 53], [263225.72, 558092.77]], 19 | [[8, 53], [330331.46, 560058.31]], 20 | [[9, 53], [397413.385, 562954.436]], 21 | [[10, 53], [464462.35, 566781.24]], 22 | [[11, 53], [531469.2, 571538.84]] 23 | ], 24 | "description": "Test 5104, Oblique stereographic, v2-0_2011-06-28.", 25 | "projections": ["+init=epsg:4289", "+init=epsg:28992"], 26 | "tests": [ 27 | {"tolerances": [5.555555555555555e-07, 0.05], "type": "conversion"}, 28 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ogc/OGCSurface.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry.ogc; 26 | 27 | public abstract class OGCSurface extends OGCGeometry { 28 | public double area() { 29 | return getEsriGeometry().calculateArea2D(); 30 | } 31 | 32 | public OGCPoint pointOnSurface() { 33 | // TODO: support this (need to port OperatorLabelPoint) 34 | throw new UnsupportedOperationException(); 35 | } 36 | 37 | public abstract OGCMultiCurve boundary(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorOverlaps.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | import com.esri.core.geometry.Operator.Type; 27 | 28 | public abstract class OperatorOverlaps extends OperatorSimpleRelation { 29 | @Override 30 | public Type getType() { 31 | return Type.Equals; 32 | } 33 | 34 | public static OperatorOverlaps local() { 35 | return (OperatorOverlaps) OperatorFactoryLocal.getInstance() 36 | .getOperator(Type.Overlaps); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/OperatorFactoryEx.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017-2020 Echo Park Labs 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | 18 | email: davidraleigh@gmail.com 19 | */ 20 | 21 | package org.epl.geometry; 22 | 23 | 24 | /** 25 | * An abstract class that represent the basic OperatorFactory interface. 26 | */ 27 | public abstract class OperatorFactoryEx { 28 | /** 29 | * Returns True if the given operator exists. The type is one of the Operator::Type values or a user defined value. 30 | */ 31 | public abstract boolean isOperatorSupported(OperatorEx.Type type); 32 | 33 | /** 34 | * Returns an operator of the given type. Throws an exception if the operator is not supported. 35 | */ 36 | public abstract OperatorEx getOperator(OperatorEx.Type type); 37 | } 38 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/failing-gigs/5203.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "GIGS Test 5203 (part 1), Position Vector 7-parameter transformation, v2.0_2011-06-28. Geographic 2D domain (EPSG method code 9606).", 3 | "projections" : [ "+init=epsg:4277", "+init=epsg:4326" ], 4 | 5 | "coordinates" : [ 6 | [ [150.00567472, 79.99487333], [150.0, 80.0] ], 7 | [ [120.0, 60.0], [119.99435889, 60.00569306] ], 8 | [ [60.00446778, 29.99566778], [60.0, 30.0] ], 9 | [ [0.0, 0.0], [-0.00089056, 0.00483333] ], 10 | [ [-60.00357056, -30.00504639], [-60.0, -30.0] ], 11 | [ [-120.0, -60.0], [-119.9918525, -59.99907361] ], 12 | [ [-150.01693111, -79.99778139], [-150.0, -80.0] ], 13 | [ [-180.0, 70.0], [-179.99637361, 70.005945] ], 14 | [ [-135.00596333, 49.99458694], [-135.0, 50.0] ], 15 | [ [-90.0, 25.0], [-89.99531139, 25.00445833] ], 16 | [ [0.00089056, -0.00483333], [0.0, 0.0] ], 17 | [ [143.9279419, -37.6532236], [143.92634806, -37.65235306] ], 18 | [ [135.00291194, -49.99973028], [135.0, -50.0] ], 19 | [ [180.0, -70.0], [-179.99660139, -70.002485] ] 20 | ], 21 | 22 | "tests" : [ {"type": "conversion", "tolerances": [2.7777777777777776e-07, 2.7777777777777776e-07]}, 23 | {"type": "roundtrip", "times":1000, "tolerances": [5.555555555555556e-08, 5.555555555555556e-08] } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/OperatorRandomPointsLocal.java: -------------------------------------------------------------------------------- 1 | package org.epl.geometry; 2 | 3 | import com.esri.core.geometry.Geometry; 4 | import com.esri.core.geometry.GeometryCursor; 5 | import com.esri.core.geometry.ProgressTracker; 6 | import com.esri.core.geometry.SimpleGeometryCursor; 7 | 8 | /** 9 | * Created by davidraleigh on 5/10/17. 10 | */ 11 | public class OperatorRandomPointsLocal extends OperatorRandomPoints { 12 | @Override 13 | public GeometryCursor execute( 14 | GeometryCursor inputPolygons, 15 | double[] pointsPerSquareKm, 16 | long seed, 17 | SpatialReferenceEx sr, 18 | ProgressTracker progressTracker) { 19 | GeometryCursor randomPointsCursor = new OperatorRandomPointsCursor(inputPolygons, pointsPerSquareKm, seed, sr, progressTracker); 20 | return randomPointsCursor; 21 | } 22 | 23 | @Override 24 | public Geometry execute( 25 | Geometry inputPolygon, 26 | double pointsPerSquareKm, 27 | long seed, 28 | SpatialReferenceEx sr, 29 | ProgressTracker progressTracker) { 30 | double[] perSqrKM = {pointsPerSquareKm}; 31 | GeometryCursor res = execute(new SimpleGeometryCursor(inputPolygon), perSqrKM, seed, sr, progressTracker); 32 | return res.next(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5103.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[5, 58], [187742.7, 969521.653]], 4 | [[5, 57], [188698.877, 857277.135]], 5 | [[5, 56], [189652.853, 745291.184]], 6 | [[5, 55], [190604.967, 633523.672]], 7 | [[5, 54], [191555.55, 521935.9]], 8 | [[5, 53], [192504.921, 410490.433]], 9 | [[5.3876389, 52.1561606], [219843.841, 316827.604]], 10 | [[4, 51], [124202.936, 187756.876]], 11 | [[4, 50], [123652.406, 76521.628]], 12 | [[4, 49], [123101.889, -34711.068]], 13 | [[3.3137281, 47.9752611], [71254.553, -148236.592]], 14 | [[3, 53], [58108.966, 411155.591]], 15 | [[4, 53], [125304.704, 410370.504]], 16 | [[5, 53], [192504.921, 410490.433]], 17 | [[6, 53], [259697.429, 411515.356]], 18 | [[7, 53], [326870.04, 413445.087]], 19 | [[8, 53], [394010.571, 416279.276]], 20 | [[9, 53], [461106.844, 420017.408]], 21 | [[10, 53], [528146.69, 424658.807]], 22 | [[11, 53], [595117.95, 430202.63]] 23 | ], 24 | 25 | "description": "Test 5103 (part 1), Lambert Conic Conformal (2SP), v2-0_2011-06-28.", 26 | "projections": ["+init=epsg:4313", "+init=epsg:31370"], 27 | "tests": [ {"tolerances": [2.7777777777777776e-07, 0.03], "type": "conversion"}, 28 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"}] 29 | } 30 | -------------------------------------------------------------------------------- /docker/proj/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG TAG=buster-0604876 2 | FROM geogrpc/c-builder:${TAG} as builder 3 | 4 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends bsdtar 5 | 6 | RUN export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") 7 | 8 | WORKDIR /opt/src 9 | RUN wget -qO- https://github.com/geo-grpc/proj.4/archive/master.zip | bsdtar -xvf- 10 | 11 | WORKDIR /opt/src/proj.4-master 12 | # CC="ccache gcc" CFLAGS="-g -Wfloat-conversion -Wall -Wextra -Werror -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wshadow -O2" 13 | RUN chmod +x autogen.sh && \ 14 | ./autogen.sh && \ 15 | CFLAGS=-I$JAVA_HOME/include/linux ./configure --with-jni=$JAVA_HOME/include --prefix=/usr/local && \ 16 | make -j 8 && \ 17 | make install && \ 18 | cd jniwrap && \ 19 | ant -v && \ 20 | mv /opt/src/proj.4-master/jniwrap/out/proj.jar /usr/local/lib/ 21 | 22 | # Horizontal datums to improve test results 23 | WORKDIR /usr/local/share/proj 24 | ARG FETCH_VERT=0 25 | ENV VERT_DATUM=$FETCH_VERT 26 | RUN chmod +x /opt/src/proj.4-master/datum-installs.sh && \ 27 | /opt/src/proj.4-master/datum-installs.sh $FETCH_VERT 28 | 29 | ENV PROJ_LIB=/usr/local/share/proj 30 | WORKDIR /opt/src/proj.4-master 31 | # TODO What's wrong here? 32 | #RUN make check && \ 33 | # cd src 34 | # make multistresstest && \ 35 | # make test228 36 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorCentroid2D.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | public abstract class OperatorCentroid2D extends Operator { 27 | @Override 28 | public Type getType() { 29 | return Type.Centroid2D; 30 | } 31 | 32 | public abstract Point2D execute(Geometry geometry, ProgressTracker progressTracker); 33 | 34 | public static OperatorCentroid2D local() { 35 | return (OperatorCentroid2D) OperatorFactoryLocal.getInstance().getOperator(Type.Centroid2D); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ogc/OGCGeometryCollection.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry.ogc; 26 | 27 | public abstract class OGCGeometryCollection extends OGCGeometry { 28 | /** 29 | * Returns the number of geometries in this GeometryCollection. 30 | */ 31 | public abstract int numGeometries(); 32 | 33 | /** 34 | * Returns the Nth geometry in this GeometryCollection. 35 | * 36 | * @param n The 0 based index of the geometry. 37 | */ 38 | public abstract OGCGeometry geometryN(int n); 39 | } 40 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ShapeImportFlags.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | /** 28 | *Flags used by the OperatorImportFromEsriShape. 29 | */ 30 | public interface ShapeImportFlags { 31 | public static final int ShapeImportDefaults = 0;//! byteBufferArray) { 32 | super(byteBufferArray); 33 | } 34 | 35 | public SimpleByteBufferCursorEx(ArrayDeque byteBufferArrayDeque, ArrayDeque ids) { 36 | super(byteBufferArrayDeque, ids); 37 | } 38 | 39 | public SimpleByteBufferCursorEx(ArrayDeque arrayDeque, ArrayDeque ids, ArrayDeque simpleStates, ArrayDeque featureIDs) { 40 | super(arrayDeque, ids, simpleStates, featureIDs); 41 | } 42 | 43 | public void tick(ByteBuffer byteBuffer) { 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/gigs/5106.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[117, 12], [807919.144, 1329535.334]], 4 | [[117, 10], [808784.981, 1107678.473]], 5 | [[117, 9], [809334.177, 996918.212]], 6 | [[117, 8], [809939.302, 886240.183]], 7 | [[116.8465522222222222224906494, 6.878458333333333334122825262], [793704.631, 762081.047]], 8 | [[117, 6], [811253.303, 665041.265]], 9 | [[117, 5], [811930.345, 554475.627]], 10 | [[117, 4], [812599.582, 443902.706]], 11 | [[115, 4], [590521.147, 442890.861]], 12 | [[117, 3], [813245.133, 333300.13]], 13 | [[117, 2], [813851.067, 222645.511]], 14 | [[117, 1], [814401.375, 111916.452]], 15 | [[109.6858208333333333333530706, -0.0001733333333333333330866171056], [0, 0]], 16 | [[123, 6], [1475669.281, 673118.573]], 17 | [[122, 6], [1364854.862, 671146.254]], 18 | [[121, 6], [1254086.173, 669446.249]], 19 | [[120, 6], [1143352.598, 668002.074]], 20 | [[119, 6], [1032643.312, 666797.354]], 21 | [[118, 6], [921947.286, 665815.815]], 22 | [[117, 6], [811253.303, 665041.265]], 23 | [[116, 6], [700549.965, 664457.586]], 24 | [[115, 6], [589825.706, 664048.715]], 25 | [[114, 6], [479068.802, 663798.63]] 26 | ], 27 | 28 | "description": "Test 5106, Hotine Oblique Mercator (variant A), v2-0_2011-06-28.", 29 | 30 | "projections": ["+init=epsg:4742", "+init=epsg:3376"], 31 | "tests": [ 32 | {"tolerances": [5.555555555555555e-07, 0.05], "type": "conversion"}, 33 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/main/java/org/epl/geometry/InverseResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017-2020 Echo Park Labs 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | 18 | email: davidraleigh@gmail.com 19 | */ 20 | 21 | package org.epl.geometry; 22 | 23 | public class InverseResult { 24 | double az12_rad = 0; 25 | double az21_rad = 0; 26 | double distance_m = 0; 27 | 28 | public InverseResult(double az12_rad, double az21_rad, double distance_m) { 29 | this.az12_rad = az12_rad; 30 | this.az21_rad = az21_rad; 31 | this.distance_m = distance_m; 32 | } 33 | 34 | 35 | public double getAz12_rad() { 36 | return az12_rad; 37 | } 38 | 39 | public void setAz12_rad(double az12_rad) { 40 | this.az12_rad = az12_rad; 41 | } 42 | 43 | public double getAz21_rad() { 44 | return az21_rad; 45 | } 46 | 47 | public void setAz21_rad(double az21_rad) { 48 | this.az21_rad = az21_rad; 49 | } 50 | 51 | public double getDistance_m() { 52 | return distance_m; 53 | } 54 | 55 | public void setDistance_m(double distance_m) { 56 | this.distance_m = distance_m; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorConvexHullLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | class OperatorConvexHullLocal extends OperatorConvexHull { 27 | @Override 28 | public GeometryCursor execute(GeometryCursor geoms, boolean b_merge, 29 | ProgressTracker progress_tracker) { 30 | return new OperatorConvexHullCursor(b_merge, geoms, progress_tracker); 31 | } 32 | 33 | @Override 34 | public Geometry execute(Geometry geometry, ProgressTracker progress_tracker) { 35 | return OperatorConvexHullCursor.calculateConvexHull_(geometry, 36 | progress_tracker); 37 | } 38 | 39 | @Override 40 | public boolean isConvex(Geometry geom, ProgressTracker progress_tracker) { 41 | return OperatorConvexHullCursor.isConvex_(geom, progress_tracker); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorShapePreservingDensifyLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | //This is a stub 28 | class OperatorShapePreservingDensifyLocal extends 29 | OperatorShapePreservingDensify { 30 | 31 | @Override 32 | public GeometryCursor execute(GeometryCursor geoms, SpatialReference sr, 33 | double maxLengthMeters, double maxDeviationMeters, double reserved, 34 | ProgressTracker progressTracker) { 35 | throw new GeometryException("not implemented"); 36 | } 37 | 38 | @Override 39 | public Geometry execute(Geometry geom, SpatialReference sr, 40 | double maxLengthMeters, double maxDeviationMeters, double reserved, 41 | ProgressTracker progressTracker) { 42 | throw new GeometryException("not implemented"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorClipLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | class OperatorClipLocal extends OperatorClip { 28 | 29 | @Override 30 | public GeometryCursor execute(GeometryCursor geoms, Envelope2D envelope, 31 | SpatialReference spatialRef, ProgressTracker progressTracker) { 32 | return new OperatorClipCursor(geoms, envelope, spatialRef, 33 | progressTracker); 34 | } 35 | 36 | @Override 37 | public Geometry execute(Geometry geom, Envelope2D envelope, 38 | SpatialReference spatialRef, ProgressTracker progressTracker) { 39 | SimpleGeometryCursor inputCursor = new SimpleGeometryCursor(geom); 40 | 41 | GeometryCursor outputCursor = execute(inputCursor, envelope, 42 | spatialRef, progressTracker); 43 | return outputCursor.next(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorExportToWktCursor.java: -------------------------------------------------------------------------------- 1 | package com.esri.core.geometry; 2 | 3 | public class OperatorExportToWktCursor extends StringCursor { 4 | private GeometryCursor m_geometryCursor; 5 | private int m_export_flags; 6 | private SimpleStateEnum simpleStateEnum = SimpleStateEnum.SIMPLE_UNKNOWN; 7 | private Envelope2D env2D = new Envelope2D(); 8 | 9 | public OperatorExportToWktCursor(int exportFlags, GeometryCursor geometryCursor, ProgressTracker progressTracker) { 10 | if (geometryCursor == null) 11 | throw new GeometryException("invalid argument"); 12 | 13 | m_export_flags = exportFlags; 14 | m_geometryCursor = geometryCursor; 15 | } 16 | 17 | @Override 18 | public String next() { 19 | Geometry geometry; 20 | if (hasNext()) { 21 | geometry = m_geometryCursor.next(); 22 | geometry.queryEnvelope2D(env2D); 23 | simpleStateEnum = geometry.getSimpleState(); 24 | StringBuilder stringBuilder = new StringBuilder(); 25 | OperatorExportToWktLocal.exportToWkt(m_export_flags, geometry, stringBuilder); 26 | return stringBuilder.toString(); 27 | } 28 | return null; 29 | } 30 | 31 | @Override 32 | public boolean hasNext() { 33 | return m_geometryCursor != null && m_geometryCursor.hasNext(); 34 | } 35 | 36 | @Override 37 | public int getID() { 38 | return m_geometryCursor.getGeometryID(); 39 | } 40 | 41 | @Override 42 | public SimpleStateEnum getSimpleState() { 43 | return simpleStateEnum; 44 | } 45 | 46 | @Override 47 | public Envelope2D getEnvelope2D() { 48 | return env2D; 49 | } 50 | 51 | @Override 52 | public String getFeatureID() { 53 | return m_geometryCursor.getFeatureID(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorClipCursor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | class OperatorClipCursor extends GeometryCursor { 28 | private Envelope2D m_envelope; 29 | double m_tolerance; 30 | 31 | OperatorClipCursor(GeometryCursor geoms, Envelope2D envelope, 32 | SpatialReference spatial_ref, ProgressTracker progress_tracker) { 33 | if (geoms == null) 34 | throw new IllegalArgumentException(); 35 | 36 | m_envelope = envelope; 37 | m_inputGeoms = geoms; 38 | 39 | m_tolerance = InternalUtils.calculateToleranceFromGeometry(spatial_ref, envelope, false); 40 | } 41 | 42 | @Override 43 | public Geometry next() { 44 | if (hasNext()) { 45 | return Clipper.clip(m_inputGeoms.next(), m_envelope, m_tolerance, 0.0); 46 | } 47 | return null; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorGeodesicBufferLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | //This is a stub 28 | class OperatorGeodesicBufferLocal extends OperatorGeodesicBuffer { 29 | 30 | @Override 31 | public GeometryCursor execute(GeometryCursor inputGeometries, 32 | SpatialReference sr, int curveType, double[] distancesMeters, 33 | double maxDeviationMeters, boolean bReserved, boolean bUnion, 34 | ProgressTracker progressTracker) { 35 | throw new GeometryException("not implemented"); 36 | } 37 | 38 | @Override 39 | public Geometry execute(Geometry inputGeometry, SpatialReference sr, 40 | int curveType, double distanceMeters, double maxDeviationMeters, 41 | boolean bReserved, ProgressTracker progressTracker) { 42 | throw new GeometryException("not implemented"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/JsonCursor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | /** 27 | * An abstract Json String Cursor class. 28 | */ 29 | public abstract class JsonCursor { 30 | 31 | /** 32 | * Moves the cursor to the next string. Returns null when reached the end. 33 | */ 34 | public abstract String next(); 35 | 36 | /** 37 | * Returns the ID of the current geometry. The ID is propagated across the 38 | * operations (when possible). 39 | *

40 | * Returns an ID associated with the current Geometry. The ID is passed 41 | * along and is returned by some operators to preserve relationship between 42 | * the input and output geometry classes. It is not always possible to 43 | * preserve an ID during an operation. 44 | */ 45 | public abstract int getID(); 46 | } 47 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorUnionLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | class OperatorUnionLocal extends OperatorUnion { 28 | 29 | @Override 30 | public GeometryCursor execute(GeometryCursor inputGeometries, 31 | SpatialReference sr, ProgressTracker progressTracker) { 32 | return new OperatorUnionCursor(inputGeometries, sr, progressTracker); 33 | } 34 | 35 | @Override 36 | public Geometry execute(Geometry geom1, Geometry geom2, 37 | SpatialReference sr, ProgressTracker progressTracker) { 38 | Geometry[] geomArray = new Geometry[] { geom1, geom2 }; 39 | 40 | SimpleGeometryCursor inputGeometries = new SimpleGeometryCursor( 41 | geomArray); 42 | GeometryCursor outputCursor = execute(inputGeometries, sr, 43 | progressTracker); 44 | 45 | return outputCursor.next(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/JsonGeometryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | /** 28 | * A runtime exception raised when a JSON related exception occurs. 29 | */ 30 | public class JsonGeometryException extends GeometryException { 31 | private static final long serialVersionUID = 1L; 32 | 33 | /** 34 | * Constructs a Json Geometry Exception with the given error string/message. 35 | * 36 | * @param str 37 | * - The error string. 38 | */ 39 | public JsonGeometryException(String str) { 40 | super(str); 41 | } 42 | 43 | /** 44 | * Constructs a Json Geometry Exception with the given another exception. 45 | * 46 | * @param ex 47 | * - The exception to copy the message from. 48 | */ 49 | public JsonGeometryException(Exception ex) { 50 | super(ex.getMessage()); 51 | } 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ogc/OGCCurve.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry.ogc; 26 | 27 | import com.esri.core.geometry.MultiPoint; 28 | 29 | public abstract class OGCCurve extends OGCGeometry { 30 | public abstract double length(); 31 | 32 | public abstract OGCPoint startPoint(); 33 | 34 | public abstract OGCPoint endPoint(); 35 | 36 | public abstract boolean isClosed(); 37 | 38 | public boolean isRing() { 39 | return isSimple() && isClosed(); 40 | } 41 | 42 | @Override 43 | public OGCGeometry boundary() { 44 | if (isEmpty()) 45 | return new OGCMultiPoint(this.getEsriSpatialReference()); 46 | 47 | if (isClosed()) 48 | return new OGCMultiPoint(new MultiPoint(getEsriGeometry() 49 | .getDescription()), esriSR);// return empty multipoint; 50 | else 51 | return new OGCMultiPoint(startPoint(), endPoint()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/failing-gigs/5102.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[2.9586342556, 64.4444444444], [760724.023, 3457334.864]], 4 | [[2.9586342556, 63.3333333333], [764567.882, 3343917.044]], 5 | [[2.9586342556, 62.2222222222], [768397.648, 3230915.06]], 6 | [[2.9586342556, 61.1111111111], [772214.859, 3118283.535]], 7 | [[2.9586342556, 60], [776020.989, 3005978.979]], 8 | [[2.9586342556, 58.8888888889], [779817.454, 2893959.584]], 9 | [[1.8475231444, 56.6666666667], [717027.602, 2668679.866]], 10 | [[1.8475231444, 55.5555555556], [719385.487, 2557240.347]], 11 | [[1.8475231444, 54.4444444444], [721740.59, 2445932.319]], 12 | [[1.8475231444, 52], [726915.726, 2201342.51838845]], 13 | [[0.7364120333, 58.8888888889], [644765.081, 2891102.088]], 14 | [[1.8475231444, 58.8888888889], [712300.356, 2892101.266]], 15 | [[2.9586342556, 58.8888888889], [779817.454, 2893959.584]], 16 | [[4.0697453667, 58.8888888889], [847305.444, 2896676.742]], 17 | [[5.1808564778, 58.8888888889], [914753.403, 2900252.301]], 18 | [[6.2919675889, 58.8888888889], [982150.413, 2904685.68]], 19 | [[7.4030787, 58.8888888889], [1049485.565, 2909976.163]], 20 | [[8.5141898111, 58.8888888889], [1116747.958, 2916122.894]], 21 | [[9.6253009222, 58.8888888889], [1183926.705, 2923124.876]] 22 | ], 23 | "description": "Test 5102 (part 2), Lambert Conic Conformal (1SP), v2-0_2011-06-28.", 24 | "projections": ["+init=epsg:4807", "+init=epsg:27572"], 25 | "tests": [ 26 | {"tolerances": [2.7777777777777776e-07, 0.03], "type": "conversion"}, 27 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /java/geometry-chain/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG TAG=buster-0604876 2 | ARG JAVA_VERSION=11.0.10 3 | ARG JRE_TAG=${JAVA_VERSION}-jre-slim-buster 4 | FROM geogrpc/proj:${TAG} as builder 5 | 6 | MAINTAINER David Raleigh 7 | 8 | # https://github.com/rocker-org/shiny/issues/19#issuecomment-308357402 9 | RUN apt-get update || apt-get update 10 | 11 | COPY ./ /opt/src/geometry-chain 12 | 13 | WORKDIR /opt/src/geometry-chain 14 | 15 | 16 | RUN ./gradlew build install 17 | # Weirdest. works in docker on mac but not in linux 18 | # RUN tar -xvf /opt/src/geometry-chain/epl-geometry-service/build/distributions/epl-geometry-service.tar 19 | RUN tar -xf /opt/src/geometry-chain/epl-geometry-service/build/distributions/epl-geometry-service.tar -C /opt/src/geometry-chain/epl-geometry-service/build/distributions 20 | 21 | 22 | # Production build 23 | FROM openjdk:${JRE_TAG} 24 | 25 | WORKDIR /usr/local 26 | COPY --from=builder /usr/local . 27 | RUN export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") 28 | 29 | ENV PROJ_LIB=/usr/local/share/proj 30 | 31 | RUN /sbin/ldconfig 32 | 33 | WORKDIR /opt/src/geometry-chain/build/install 34 | COPY --from=builder /opt/src/geometry-chain/epl-geometry-service/build/distributions/epl-geometry-service ./ 35 | 36 | RUN chmod +x /opt/src/geometry-chain/build/install/bin/geometry-operators-server 37 | 38 | EXPOSE 8980 39 | 40 | WORKDIR /opt/src/geometry-chain/build/test-results 41 | COPY --from=builder /opt/src/geometry-chain/epl-geometry-service/build/test-results . 42 | COPY --from=builder /opt/src/geometry-chain/epl-geometry-api/build/test-results . 43 | COPY --from=builder /opt/src/geometry-chain/epl-geometry-api-ex/build/test-results . 44 | 45 | CMD /opt/src/geometry-chain/build/install/bin/geometry-operators-server 46 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorImportFromGeoJsonCursor.java: -------------------------------------------------------------------------------- 1 | package com.esri.core.geometry; 2 | 3 | public class OperatorImportFromGeoJsonCursor extends MapGeometryCursor { 4 | StringCursor m_jsonStringCursor; 5 | int m_import_flags; 6 | int m_count; 7 | 8 | // TODO, this was never implemented. Maybe remove? 9 | // public OperatorImportFromGeoJsonCursor(int import_flags, String geoJsonString, ProgressTracker progressTracker) { 10 | // m_geoJsonString = geoJsonString; 11 | // m_import_flags = import_flags; 12 | // m_index = -1; 13 | // m_count = 1; 14 | // } 15 | 16 | public OperatorImportFromGeoJsonCursor(int import_flags, StringCursor stringCursor, ProgressTracker progressTracker) { 17 | m_jsonStringCursor = stringCursor; 18 | m_import_flags = import_flags; 19 | m_count = 1; 20 | } 21 | 22 | @Override 23 | public MapGeometry next() { 24 | String nextString; 25 | if ((nextString = m_jsonStringCursor.next()) != null) { 26 | JsonReader jsonReader = JsonParserReader.createFromString(nextString); 27 | return OperatorImportFromGeoJsonLocal.OperatorImportFromGeoJsonHelper.importFromGeoJson(m_import_flags, Geometry.Type.Unknown, jsonReader, null, false); 28 | } 29 | return null; 30 | } 31 | 32 | @Override 33 | public SimpleStateEnum getSimpleState() { 34 | return m_jsonStringCursor.getSimpleState(); 35 | } 36 | 37 | @Override 38 | public String getFeatureID() { 39 | return m_jsonStringCursor.getFeatureID(); 40 | } 41 | 42 | @Override 43 | public int getGeometryID() { 44 | return m_jsonStringCursor.getID(); 45 | } 46 | 47 | @Override 48 | public boolean hasNext() { 49 | return m_jsonStringCursor != null && m_jsonStringCursor.hasNext(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/WkbExportFlags.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | /** 28 | *Flags used by the OperatorExpotToWkb. 29 | */ 30 | public interface WkbExportFlags { 31 | public static final int wkbExportDefaults = 0;//!= b 35 | temp = b; 36 | b = a; 37 | a = temp; 38 | } 39 | 40 | if (c > a) { 41 | // set a >= c 42 | temp = c; 43 | c = a; 44 | a = temp; 45 | } 46 | 47 | if (c > b) { 48 | temp = c; 49 | c = b; 50 | b = temp; 51 | } 52 | 53 | // First sort a, b, c so that a ≥ b ≥ c ; this can be done at the cost of at most three comparisons. 54 | // If c-(a-b) < 0 then the data are not side-lengths of a real triangle 55 | if (c - (a - b) < 0) 56 | return 0.0; 57 | 58 | //double result = 0.5 * Math.abs((x - pt2.x)*(pt1.y - y) - (x - pt1.x)*(pt2.y - y)); 59 | return Math.sqrt((a + (b + c)) * (c - (a - b)) * (c + (a - b)) * (a + (b - c))) / 4.0; 60 | 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/test/java/com/esri/core/geometry/TestWkid.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | import static org.junit.Assert.*; 28 | import junit.framework.TestCase; 29 | 30 | import org.junit.Test; 31 | 32 | public class TestWkid extends TestCase { 33 | @Test 34 | public void test() { 35 | SpatialReference sr = SpatialReference.create(102100); 36 | assertTrue(sr.getID() == 102100); 37 | assertTrue(sr.getLatestID() == 3857); 38 | assertTrue(sr.getOldID() == 102100); 39 | assertTrue(sr.getTolerance() == 0.001); 40 | 41 | SpatialReference sr84 = SpatialReference.create(4326); 42 | double tol84 = sr84.getTolerance(); 43 | assertTrue(Math.abs(tol84 - 1e-8) < 1e-8 * 1e-8); 44 | } 45 | 46 | 47 | @Test 48 | public void test_80() { 49 | SpatialReference sr = SpatialReference.create(3857); 50 | assertTrue(sr.getID() == 3857); 51 | assertTrue(sr.getLatestID() == 3857); 52 | assertTrue(sr.getOldID() == 102100); 53 | assertTrue(sr.getTolerance() == 0.001); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorOffsetLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | class OperatorOffsetLocal extends OperatorOffset { 27 | 28 | @Override 29 | public GeometryCursor execute(GeometryCursor inputGeometries, 30 | SpatialReference sr, double distance, JoinType joins, 31 | double bevelRatio, double flattenError, 32 | ProgressTracker progressTracker) { 33 | return new OperatorOffsetCursor(inputGeometries, sr, distance, joins, 34 | bevelRatio, flattenError, progressTracker); 35 | } 36 | 37 | @Override 38 | public Geometry execute(Geometry inputGeometry, SpatialReference sr, 39 | double distance, JoinType joins, double bevelRatio, 40 | double flattenError, ProgressTracker progressTracker) { 41 | SimpleGeometryCursor inputCursor = new SimpleGeometryCursor( 42 | inputGeometry); 43 | GeometryCursor outCursor = execute(inputCursor, sr, distance, joins, 44 | bevelRatio, flattenError, progressTracker); 45 | return outCursor.next(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorExportToEWkbLocal.java: -------------------------------------------------------------------------------- 1 | package com.esri.core.geometry; 2 | 3 | import java.nio.ByteBuffer; 4 | import java.nio.ByteOrder; 5 | 6 | import static com.esri.core.geometry.OperatorExportToWkbLocal.exportToWKB; 7 | 8 | public class OperatorExportToEWkbLocal extends OperatorExportToEWkb { 9 | @Override 10 | public ByteBufferCursor execute(int exportFlags, GeometryCursor geometryCursor, SpatialReference spatialReference) { 11 | return new OperatorExportToEWkbCursor(exportFlags, geometryCursor, spatialReference); 12 | } 13 | 14 | @Override 15 | public ByteBuffer execute(int exportFlags, Geometry geometry, SpatialReference spatialReference, ProgressTracker progressTracker) { 16 | int srid = getSrid(spatialReference); 17 | 18 | int size = exportToEWKB(exportFlags, geometry, null, srid); 19 | ByteBuffer wkbBuffer = ByteBuffer.allocate(size).order(ByteOrder.nativeOrder()); 20 | exportToEWKB(exportFlags, geometry, wkbBuffer, srid); 21 | return wkbBuffer; 22 | } 23 | 24 | @Override 25 | public int execute(int exportFlags, Geometry geometry, SpatialReference spatialReference, ByteBuffer wkbBuffer, ProgressTracker progressTracker) { 26 | int srid = getSrid(spatialReference); 27 | 28 | return exportToEWKB(exportFlags, geometry, wkbBuffer, srid); 29 | } 30 | 31 | protected static int getSrid(SpatialReference spatialReference) { 32 | if (spatialReference != null && spatialReference.getText() != null) { 33 | throw new GeometryException("spatial reference for extended wkb export must be an integer id, wkt not permitted"); 34 | } 35 | return spatialReference == null ? 0 : spatialReference.getID(); 36 | } 37 | 38 | private static int exportToEWKB(int exportFlags, Geometry geometry, ByteBuffer wkbBuffer, int srid) { 39 | return exportToWKB(exportFlags | WkbExportFlags.wkbExportAsExtendedWkb, geometry, wkbBuffer, srid); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/ShapeModifiers.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | interface ShapeModifiers { 28 | public static final int ShapeHasZs = 0x80000000; 29 | public static final int ShapeHasMs = 0x40000000; 30 | public static final int ShapeHasCurves = 0x20000000; 31 | public static final int ShapeHasIDs = 0x10000000; 32 | public static final int ShapeHasNormals = 0x08000000; 33 | public static final int ShapeHasTextures = 0x04000000; 34 | public static final int ShapeHasPartIDs = 0x02000000; 35 | public static final int ShapeHasMaterials = 0x01000000; 36 | public static final int ShapeIsCompressed = 0x00800000; 37 | public static final int ShapeModifierMask = 0xFF000000; 38 | public static final int ShapeMultiPatchModifierMask = 0x0F00000; 39 | public static final int ShapeBasicTypeMask = 0x000000FF; 40 | public static final int ShapeBasicModifierMask = 0xC0000000; 41 | public static final int ShapeNonBasicModifierMask = 0x3F000000; 42 | public static final int ShapeExtendedModifierMask = 0xDD000000; 43 | } 44 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorDifferenceCursor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | 25 | package com.esri.core.geometry; 26 | 27 | class OperatorDifferenceCursor extends GeometryCursor { 28 | ProgressTracker m_progress_tracker; 29 | SpatialReference m_Spatial_reference; 30 | Geometry m_geomSubtractor; 31 | boolean m_bEmpty; 32 | 33 | OperatorDifferenceCursor(GeometryCursor inputGeoms, 34 | GeometryCursor geomSubtractor, SpatialReference sr, 35 | ProgressTracker progress_tracker) { 36 | m_bEmpty = (geomSubtractor == null); 37 | m_inputGeoms = inputGeoms; 38 | m_Spatial_reference = sr; 39 | m_geomSubtractor = geomSubtractor.next(); 40 | m_progress_tracker = progress_tracker; 41 | } 42 | 43 | @Override 44 | public Geometry next() { 45 | if (m_bEmpty) 46 | return null; 47 | 48 | if (hasNext()) { 49 | return OperatorDifferenceLocal.difference( 50 | m_inputGeoms.next(), 51 | m_geomSubtractor, 52 | m_Spatial_reference, 53 | m_progress_tracker); 54 | } 55 | return null; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api-ex/src/test/resources/org/epl/geometry/failing-gigs/5101.4-jhs.json: -------------------------------------------------------------------------------- 1 | { 2 | "coordinates": [ 3 | [[-63.9993433, 80.0002644], [5422500.0, 18889800.0]], 4 | [[-63.9998472, 60.0001191], [5276900.0, 16662800.0]], 5 | [[-63.9997361, 40.0003081], [5158399.999, 14439199.99]], 6 | [[-64.0004605, 19.9996448], [5081100.0, 12219300.0]], 7 | [[-63.9996186, 0.0003092], [5054400.005, 10002000.0]], 8 | [[-64.0004675, -19.9999283], [5081100.017, 7784599.993]], 9 | [[-63.9997001, -39.9996924], [5158400.0, 5564800.0]], 10 | [[-63.9998814, -60.0004008], [5276899.994, 3341099.995]], 11 | [[-63.9991006, -79.9996521], [5422500.0, 1114200.0]], 12 | [[-70.0002089, -40.000215], [4645300.113, 5524200.123]], 13 | [[-69.0001441, -40.0002935], [4730900.0, 5533400.0]], 14 | [[-67.9995333, -39.9996136], [4816500.043, 5541700.028]], 15 | [[-66.9998073, -39.9999313], [4902000.0, 5548900.0]], 16 | [[-65.9996522, -39.9995894], [4987500.009, 5555200.001]], 17 | [[-64.9992796, -40.000411], [5073000.0, 5560400.0]], 18 | [[-63.9997, -39.9996925], [5158400.01, 5564799.987]], 19 | [[-62.9999842, -40.0002087], [5243800.0, 5568100.0]], 20 | [[-62.0000778, -40.0001803], [5329199.995, 5570500.009]], 21 | [[-61.0000574, -39.9996182], [5414600.0, 5572000.0]], 22 | [[-60, -40.0003306], [5500000.0, 5572399.996]], 23 | [[-58.9999426, -39.9996182], [5585400.0, 5572000.0]], 24 | [[-57.9999222, -40.0001803], [5670800.005, 5570500.009]], 25 | [[-57.0000158, -40.0002087], [5756200.0, 5568100.0]] 26 | ], 27 | "description": "Test 5101 (part 4), Transverse Mercator, v2-0_2011-06-28, recommended JHS formula", 28 | "projections": ["+init=epsg:4190", "+init=epsg:22175"], 29 | "tests": [ 30 | {"tolerances": [2.7777777777777776e-07, 0.03], "type": "conversion"}, 31 | {"times": 1000, "tolerances": [5.555555555555556e-08, 0.006], "type": "roundtrip"} 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/MapGeometryCursor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | import java.util.Iterator; 27 | 28 | /** 29 | * An abstract Geometry Cursor class. 30 | */ 31 | public abstract class MapGeometryCursor implements Iterator { 32 | 33 | /** 34 | * Moves the cursor to the next ProjectedGeometry. Returns null when reached 35 | * the end. 36 | */ 37 | public abstract MapGeometry next(); 38 | 39 | /** 40 | * Returns the ID of the current geometry. The ID is propagated across the 41 | * operations (when possible). 42 | *

43 | * Returns an ID associated with the current Geometry. The ID is passed 44 | * along and is returned by some operators to preserve relationship between 45 | * the input and output geometry classes. It is not always possible to 46 | * preserve an ID during an operation. 47 | */ 48 | public abstract int getGeometryID(); 49 | 50 | public abstract String getFeatureID(); 51 | 52 | public abstract SimpleStateEnum getSimpleState(); 53 | 54 | public abstract boolean hasNext(); 55 | } 56 | -------------------------------------------------------------------------------- /java/geometry-chain/epl-geometry-api/src/main/java/com/esri/core/geometry/OperatorExportToJsonLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 1995-2015 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | For additional information, contact: 17 | Environmental Systems Research Institute, Inc. 18 | Attn: Contracts Dept 19 | 380 New York Street 20 | Redlands, California, USA 92373 21 | 22 | email: contracts@esri.com 23 | */ 24 | package com.esri.core.geometry; 25 | 26 | import java.util.Map; 27 | 28 | class OperatorExportToJsonLocal extends OperatorExportToJson { 29 | 30 | @Override 31 | public StringCursor execute(SpatialReference spatialReference, 32 | GeometryCursor geometryCursor) { 33 | return new OperatorExportToJsonCursor(spatialReference, geometryCursor); 34 | } 35 | 36 | @Override 37 | public String execute(SpatialReference spatialReference, Geometry geometry) { 38 | SimpleGeometryCursor gc = new SimpleGeometryCursor(geometry); 39 | StringCursor cursor = new OperatorExportToJsonCursor(spatialReference, gc); 40 | return cursor.next(); 41 | } 42 | 43 | @Override 44 | public String execute(SpatialReference spatialReference, 45 | Geometry geometry, Map exportProperties) { 46 | return OperatorExportToJsonCursor.exportToString(geometry, spatialReference, exportProperties); 47 | } 48 | } 49 | --------------------------------------------------------------------------------