<html>
<head>
<title></title>
<meta name="GENERATOR" content="MSHTML 8.00.6001.18852"></meta>
<meta name="SKYPE_FRAMEID" content="UKSDOXEVME"></meta>
<meta id="skype_v3_tb_marker_id" name="SKYPE_PARSING_HAS_FINISHED" content="metacontent"></meta>
</head>
<body>
<div align="left">My first post was just about how to move the information internally that an empty geometry should be returned, from my function lw_dist2d_distanceline in measures.c to function LWGEOM_shortestline2d in lwgeom_functions_basic, when the expected return is LWLINE</div>
<div align="left"> </div>
<div align="left">But I have realised that the thing is a little bit bigger because I out to return the right type externally too.</div>
<div align="left">Otherwise it will violate constraints if people tries to put the result in a table.</div>
<div align="left"> </div>
<div align="left">Is this solved in other functions like st_union or st_difference?</div>
<div align="left"> </div>
<div align="left">/Nicklas</div>
<div align="left"> </div>
<div align="left"> </div>
<div align="left"><br />
<br />
2009-11-22 Paul Ramsey wrote:<br />
<br />
You are constructing empty geometries? Why? (Or is this a question of<br />
>curiosity?)<br />
><br />
>From an API PoV we should probably make some functions to do this, but<br />
>the details are, generally, an LWGEOM with a POINTARRAY that has<br />
>npoints = 0. Or, for collections, a collection with ngeoms = 0. I<br />
>believe I also consider LWGEOMs with a null POINTARRAY or a null<br />
>**geoms to be empty, but I'd have to confirm. The exact way of<br />
>representing empty things was never fully documented<br />
><br />
>P.<br />
><br />
>On Sat, Nov 21, 2009 at 4:13 PM, Nicklas Avén<br />
>
<nicklas.aven@jordogskog.no></nicklas.aven@jordogskog.no> wrote:<br />
>> OK<br />
>><br />
>> But what to send as empty when LWLINE or LWPOINT is wanted, not<br />
>> LWCOLLECTION.<br />
>> internally I mean.<br />
>> /Nicklas<br />
>><br />
>> 2009-11-22 Paul Ramsey wrote:<br />
>><br />
>> No, bad idea. Empty geometries have a type. There's 'POLYGON EMPTY',<br />
>>>'LINESTRING EMPTY', etc, etc, etc.<br />
>>><br />
>>>P.<br />
>>><br />
>>>On Sat, Nov 21, 2009 at 2:04 PM, Nicklas Avén<br />
>>> wrote:<br />
>>>> is type 0 for LWGEOM occupied by anything or could it be an idea to use<br />
>>>> it<br />
>>>> for empty geometries.<br />
>>>> Then it would be easy to create any emtpy geometry. Like a generic empty<br />
>>>> geometry.<br />
>>>><br />
>>>> Or is there another way that I have missed.<br />
>>>><br />
>>>> When I have identified the empty geometries, in shortestline and it<br />
>>>> buddies<br />
>>>> I need to communicate that an empty geometry should be returned and the<br />
>>>> datatype is LWLINE and LWPOINT for st_closestpoint. I'm tempted to just<br />
>>>> make<br />
>>>> an LWGEOM with type 0. Is it a bad idea.<br />
>>>><br />
>>>> #define EMPTY 0<br />
>>>> #define POINTTYPE 1<br />
>>>> #define LINETYPE 2<br />
>>>> #define POLYGONTYPE 3<br />
>>>> and so on<br />
>>>><br />
>>>> /Nicklas<br />
>>>> _______________________________________________<br />
>>>> postgis-devel mailing list<br />
>>>> postgis-devel@postgis.refractions.net<br />
>>>> http://postgis.refractions.net/mailman/listinfo/postgis-devel<br />
>>>><br />
>>>><br />
>>>_______________________________________________<br />
>>>postgis-devel mailing list<br />
>>>postgis-devel@postgis.refractions.net<br />
>>>http://postgis.refractions.net/mailman/listinfo/postgis-devel<br />
>>><br />
>>><br />
>> _______________________________________________<br />
>> postgis-devel mailing list<br />
>> postgis-devel@postgis.refractions.net<br />
>> http://postgis.refractions.net/mailman/listinfo/postgis-devel<br />
>><br />
>><br />
>_______________________________________________<br />
>postgis-devel mailing list<br />
>postgis-devel@postgis.refractions.net<br />
>http://postgis.refractions.net/mailman/listinfo/postgis-devel<br />
><br />
></div>
</body>
</html>