Opened 15 years ago

Closed 15 years ago

#298 closed defect (fixed)

ST_GeographFromText to object with no SRID denoted is coming in with unknown SRID

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.0
Component: postgis Version: master
Keywords: Cc:

Description

I was under the impression that if the SRID of a geography is unspecified we assume its 4326, yet I get an error with the second.

SELECT ST_AsText(ST_Intersection(ST_GeographyFromText('SRID=4326;POINT(1.2456 2)'), 
		ST_geographyFromText('SRID=4326;POINT(1.2456 2)')));  

Give me the cutesy answer of

POINT(1.2456000000062 1.99999999999996)

But the below throws an error:

ERROR:  Input geometry has unknown (-1) SRID
CONTEXT:  SQL function "st_intersection" statement 1
SELECT ST_AsText(ST_Intersection(ST_GeographyFromText('POINT(1.2456 2)'), 
		ST_GeographyFromText('POINT(1.2456 2)'))); 

I can only assume this will break all our transform hacks. So we should either not allow people to create geographies with no designated SRID or assume it 4326 if not specified.

Change History (1)

comment:1 by pramsey, 15 years ago

Resolution: fixed
Status: newclosed

Repaired in trunk at r4835. Make an unknown geography SRID translate to a 4326 geometry SRID during a cast.

Note: See TracTickets for help on using tickets.