Update makefile and add margin to border detection to cover rounding

This commit is contained in:
Bertold Van den Bergh 2019-12-13 16:15:25 +00:00
parent f52c8f4135
commit 2f1bfdebe2
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ obj/%.o: src/%.c $(INCLUDES_SRC)
clean:
rm -rf $(OBJECTS_OBJ) $(EXECUTABLE)
install:
install: $(EXECUTABLE)
install -m 0755 -d $(DESTDIR)$(includedir) $(DESTDIR)$(libdir)
install -m 0644 -t $(DESTDIR)$(includedir) zonedetect.h
ifeq ($(OS),Windows_NT)

View file

@ -700,7 +700,7 @@ static ZDLookupResult ZDPointInPolygon(const ZoneDetect *library, uint32_t polyg
/* Check if the target is on the border */
const int32_t intersectLon = (int32_t)(((float)latFixedPoint - b) / a);
if(intersectLon == lonFixedPoint) {
if(intersectLon >= lonFixedPoint-1 && intersectLon <= lonFixedPoint+1) {
if(distanceSqrMin) *distanceSqrMin = 0;
return ZD_LOOKUP_ON_BORDER_SEGMENT;
}