Esri / Esri/geometry-api-java

the tolerance in intersection of envelopes is not working

Open
#123 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
710
Forks
269
Avg merge
7d 23h
Merged PRs (30d)
1

Description

it is not worked when i do the intersection operator by setting the spatial reference which tolerance is 0.001. however the result is not empty.
Envelope env1=new Envelope();
env1.setCoords(110.5657682255, 10, 113.5685453456, 15);
Envelope env2=new Envelope();
env2.setCoords(113.5685451456, 10, 118.568545, 15);
Geometry geo1=(Geometry) env1;
Geometry geo2=(Geometry) env2;
String srs="";
SpatialReference insrs=SpatialReference.create(srs);
System.out.println(insrs.getTolerance());//0.001
Geometry geo3=GeometryEngine.intersect(geo1, geo2, insrs);
if(!geo3.isEmpty()){ //it is not empty
System.out.println(GeometryEngine.geometryToWkt(geo3, 0));
//POLYGON ((113.5685451456 10, 113.5685453456 10, 113.5685453456 15, 113.5685451456 15, 113.5685451456 10))
}

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Envelope, SpatialReference, and GeometryEngine.intersect example to reproduce the non-empty result. Then inspect the intersect and tolerance behavior exposed by those entry points; done means the result follows the spatial reference tolerance and the relevant regression case passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.