Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example, I have 2 points and I want to know if they intersect. If yes, I need to delete first points. Should I use OpenLayers .intersects method? Because it greatly depends on zoom level.

Or should I use distanceTo method?

Or how should I do control intersections?

share|improve this question
why not just compare their coordinates x , y ? – geogeek Apr 9 '13 at 18:22
For example, I have OpenLayers.Geometry.Point(0,45) and OpenLayers.Geometry.Point(0,46).Their geometries are not the same, but if zoom level is quite big, user sees that features are intersecting. Ofc it also depends on strokeWidth parameter. – Bob Apr 9 '13 at 18:27

This issue deals with an important point when it comes to GIS data: Spatial Resolution & Precision.

You have said in the comment that that a point (0, 45) & (0, 46) might appear to be on the same location given a low enough zoom level. How do you tackle this? Do you want the tolerance value to change depending on the Zoom level? Or do you want it to be fixed? Say that two points are coincident, if they lie within 2 m of each other?

In either case, you will need the distance measurement.

For Points it doesn't make sense to use exact point coincidence or intersection, since that is pretty much useless due to floating point precession used in computer systems.On a related note, Every Computer Scientist Should Know About Floating-Point Arithmetic

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.