Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PostGIS 3+ ST_GeomFromGeoJSON defaults to SRID=4326 if not specified otherwise. SimpleFeatureCollection -> GeoJSON contains only type and coordinates, no crs. I think it's easier to use st_setsrid than add crs to every geojson.
https://postgis.net/docs/ST_GeomFromGeoJSON.html
Migrate existing geometries to native srid to fix mixed srid. Some spatial queries doesn't work with mixed srid. Geometries added before PostGIS 3 have srid
0
and geometries added with version 3 have4326
. Note that coordinates were stored always in native srs/srid. So no need for transformation. Only update info/metadata.Fixes issue where GeoServer userlayer datastore doesn't use 'loose bbox' option and GeoServer didn't get features from db with intersects query and exception were thrown.
Maybe we should set srid to geometry columns to be sure that geometries doesn't get mixed srid (throws error if inserted geometry srid doesn't match columns srid)
Like:
UpdateGeometrySRID('user_layer_data','geometry',${srid});
Didn't set for now because
vuser_layer_data
view usesuser_layer_data
table. Have to drop view before set and is view needed anymore if we are aiming to use direct queries to db (without GeoServer).