Skip to content

Issue in SQL used for creating CrsMapEntry in GeoJSONTypeHandlerResolver.cs #4626

@boggob

Description

@boggob

The query looks like this:
SELECT min(srid), max(srid), auth_name
FROM(SELECT srid, auth_name, srid - rank() OVER(ORDER BY srid) AS range FROM spatial_ref_sys) AS s
GROUP BY range, auth_name
ORDER BY 1;

This has overlaps when there are consecutive srids from different auth_srid e.g.:
Notice the the ESRI and EPSG entries are consecutive
image
The query in the code results in overlaps:
image

Changing the code to this seems to fix the problem:
SELECT min(srid), max(srid), auth_name
FROM(SELECT srid, auth_name, srid - rank() OVER(ORDER BY srid) AS range FROM spatial_ref_sys) AS s
GROUP BY range, auth_name
ORDER BY 1;

image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions