Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1482 closed defect (fixed)

ERROR: Negative SRID is not for GEOGRAPHY at character 69

Reported by: strk Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:

Description

Try this:

select 'POINT(0 0)'::geography(point, 0);

Should behave the same as omitting the SRID instead.

Change History (6)

comment:1 by strk, 13 years ago

I have some doubts about what needs to be done here, as the code has an explicit block added to check for the condition of an explicit UNKNOWN srid being given. See source:trunk/postgis/gserialized_typmod.c?rev=8615#L242

comment:2 by robe, 13 years ago

no it shouldn't. You can't have geography have an unknown. So geography(point) is the same as geography(point,4326)

geography(point,0) is totally illogical and no one should even be trying to doit and should get a nasty message if they do.

comment:3 by strk, 13 years ago

Resolution: fixed
Status: newclosed

I guess the sanest thing is to consider UNKNOWN as omitted, which is using the default of 4326. Done so with r8862.

Remember: 0 == omitted == UNKNOWN

We discussed about 0 being the same as omitted with geometry as well, didn't we ? When I complained about being able to do : 'SRID=4326;POINT(0 0)'::geometry(point, 0);

comment:4 by robe, 13 years ago

Yes we did and we concluded its NOT the same.

In geometry omitted means you can have a mixed bag of geometries with various SRIDS - no SRID constraint checking is happening

where as 0 means you want it to be unknown.

comment:5 by strk, 13 years ago

Here's the discussion I'm talking about: ticket #1235, you convinced me of the contrary.

comment:6 by robe, 13 years ago

ah okay — I stand corrected. I forgot we decided its stupid to apply any spatial constraint to unknown.

Note: See TracTickets for help on using tickets.