Opened 4 years ago

Closed 4 years ago

#4803 closed defect (invalid)

Geometry SRID does not match column SRID

Reported by: tobwen Owned by: pramsey
Priority: medium Milestone: PostGIS 3.1.0
Component: postgis Version: master
Keywords: Cc:

Description

summary

It's unknown if it's a bug or a feature.

Snippet 2 works as expected, snippet 1 works in PostGIS v3.1alpha, but throws an error in 'PostGIS v3.0':

ERROR: Geometry SRID (0) does not match column SRID (3035)

snippet 1

SELECT
    ST_MakeBox2D(
        ST_MakePoint(easting * scale, northing * scale),
        ST_MakePoint(easting * scale + width, northing * scale + width)
    )::geometry(Polygon, 3035)
FROM
    (SELECT 1000 easting, 1000 northing, 1 scale, 100 width) sq;

snippet 2

SELECT
    ST_SetSRID(ST_MakeBox2D(
        ST_MakePoint(easting * scale, northing * scale),
        ST_MakePoint(easting * scale + width, northing * scale + width)
    ), 3035)::geometry(Polygon, 3035)
FROM
    (SELECT 1000 easting, 1000 northing, 1 scale, 100 width) sq;

Change History (1)

comment:1 by tobwen, 4 years ago

Resolution: invalid
Status: newclosed

Is a feature as stated in #4569

Note: See TracTickets for help on using tickets.