# Does intesect result change with CRS choice?

Question

Before (some) spatial analysis, we need to make sure the coordinate reference systems of the layers are the same. I am doing `intersect` with two layers. I did that under a coordinate before. If I change the coordinate, will the result also be changed?

Details

I use `r` language for GIS analysis, especially the package `sf`.

Before spatial analysis, I first define the CRS used for the data analysis flow.

``````my_crs <- 6668
# 6668 is the EPSG id of the geographical coordinate system JGD 2011
# which is basically the same as WGS 84
``````

Then I have two `sf` data, one is point data (which is about 10000 points), and another one is polygon data. Let's say their names are "my_point" and "my_polygon". Then I want to get the points intersecting with the polygon, so:

``````my_inter <- st_intersection(my_point, my_polygon)
``````

I wonder if I change the `my_crs` into another one, for example, `my_crs <- 6676` (6676 is a projected coordinate reference system), then I do `my_inter <- st_intersection(my_point, my_polygon)`. I found the results changed a little bit. I wonder why is that.

• Yes, CRS affects the location of the intersection. Take for example a rectangle created in a geographic coordinate system and then project it to UTM it becomes a trapezoid, likewise data that is clipped in the geographic coordinate system would no longer match the edges of the trpezoid. The difference between two projected coordinate systems isn't likely to be as pronounced but it will still be more than 0. Jun 8 at 2:50
• Yes, the number of points within a polygon can change if they're very near the edge and/or your polygon is made up from very long sections between vertices. You can minimise the effect by densifying the polygon gis.stackexchange.com/questions/29578/… before projecting, this will make the straight lines bend with the transformation in an attempt to keep topological relationships. Jun 8 at 4:05
• The result could be changed, but there are a ton of potential complications based on which CRS is used, and what you are measuring, and at what resolution. That leads to the seminal work on fractals that asks, "How long is the coast of Britain?" (Mandelbrot). Jun 8 at 4:08
• No, use the native projection of the polygons, any kind of projection will introduce uncertainty. Points can be projected as there are no straight lines to worry about so I'd project the points to match the polygon coordinate reference system. Jun 8 at 4:53
• See also the good images in gis.stackexchange.com/questions/461265/…. Algorithms often reproject just the existing vertices without doing densification and that can lead into errors in spatial relationships if the properly reprojected geometry should have curved lines between vertices. Your case with a point and a circle is not so error prone. The point will be projected accurately and circle has plenty of vertices. Jun 8 at 6:25