Checking that a position is inside a AREA works in EPSG:25382 projection, but not in CRS84

Hi @sfuerst , welcome to the forum.

We distinguish between the concept of Point and the concept of coords of the Point in our software stack. Check the outputs in your example:

julia> Point(3.2e5, 5.4e6)
Point with Cartesian{NoDatum} coordinates
├─ x: 320000.0 m
└─ y: 5.4e6 m

julia> LatLon(52.5, 13)
GeodeticLatLon{WGS84Latest} coordinates
├─ lat: 52.5°
└─ lon: 13.0°

The first object is a Point with Cartesian coordinates without a specified datum. The second object are GeodeticLatLon coordinates with WGS84Latest datum.

You can construct Point with coordinates of any type:

julia> Point(LatLon(52.5, 13))
Point with GeodeticLatLon{WGS84Latest} coordinates
├─ lat: 52.5°
└─ lon: 13.0°

The point in geom predicate does not work if you only pass coordinates. It expects a Point.

Also, when you type Point(3.2e5, 5.4e6) in g_area you are assuming that g_area is in Projected or Cartesian coordinates. If your shapefiles come in LatLon coordinates, it would be safer to create a point in the same coordinate reference system. You can extract the crs(g_area) or the crs(germany) in your example to construct coordinates of the same type.

Please let me know if you need further assistance. Happy to help you with these concepts.

A good resource to learn this in more depth is the GDSJL book:

2 Likes