[postgis-devel] ST_asGML strictness

strk strk at keybit.net
Mon Mar 22 16:53:10 PDT 2010


On Tue, Mar 23, 2010 at 12:45:32AM +0100, Olivier Courtin wrote:

> >But anyway my solution also doesn't convince me much, it being:
> >	omitted or null prefix : <prefix> == "gml"
> >	non-empty prefix       : <prefix> + :
> >	empty prefix           : no prefix (and no colon)
> 
> Seems good to me,
> 
> As you keep backward compatibility,
> with the 'omitted' case
> 
> >what doesn't convince me much with this is the impossibility
> >to get a prefix consisting of an empty string + a ':' character.
> 
> I don't get this point,
> what do you mean ?

Let's assume, for simplicity, that we take only two args:
the geom and the prefix.
Here are the 3 possibilities:

 $ select st_asgeom('POINT(0 0)', null);
 <gml:Point><gml:pos srsDimension="2">0 0</gml:pos></gml:Point>

 $ select st_asgeom('POINT(0 0)', '');
 <Point><pos srsDimension="2">0 0</pos></Point>

 $ select st_asgeom('POINT(0 0)', 'cst');
 <cst:Point><cst:pos srsDimension="2">0 0</cst:pos></cst:Point>

There would be no way to obtain this:

 <:Point><:pos srsDimension="2">0 0</:pos></:Point>

Because the empty prefix '' would be interpreted as something
special, where even the colon char would be removed.

In an ideal world the null value would have that semantic,
but we'll need null as a special case to retain backward 
compatibility.


> >So all in all I'm happy if you take care of the interface part
> >and am fine with your solution.
> 
> I will look (soon) at the new liblwgeom commited code,
> and keep you on touch on this

If it helps for quicker review, the blueprint is that
the liblwgeom code always _requires_ a prefix (const char*)
which includes the colon character.

This was done so to decide the whole interface in the ST_ family.

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list