-
Notifications
You must be signed in to change notification settings - Fork 4
What if the user specifies an unmatching CRS #10
Description
I was wondering about the follwing question. It's nothing time critical, just a thought about an improvement for the future.
Let's say the user wants to import data from WFS with actual CRS EPSG:25832, which would be transformed to EPSG:4326 during import.
But what if the user, who has to manually specifiy the CRS parameter in the import request, specifies some other CRS, e.g. EPSG:31466? Maybe the import will succeed, but definitely not with coordinates in EPSG:4326 as the transformation - should there happen any - will produce some other coordinates.
Is there any chance to detect the actually used coordinate system from the submitted dataset? Geotools might offer some method schema.getCoordinateReferenceSystem();, which gets CRS information from FeatureType, if present. Of course, NULL values might occur, if the input dataset does not specify its CRS information appropriately.
Two things might be done based on that extracted information:
- One might use that automatically extracted CRS information - if present and NOT NULL - to compare it to the user-submitted CRS information to either:
- throw an error, like
Mismatch of CRS parameter. Request contained CRS parameter "EPSG:25832", but dataset inspection showed that geometries actually use "EPSG:4326" - override request parameter with the CRS information from the source dataset
- throw an error, like
- if no valid CRS information can be extracted from input dataset, then assume that user definition in request must be correct
Maybe we can discuss that in more detail.