[postgis-users] Using exteriorring

RIBOT, Nicolas nicolas.ribot at astrium.eads.net
Fri Feb 18 09:25:07 PST 2005


> ExteriorRing() returns a LINESTRING, as per OGC specifications.
> Output column should be LINESTRING.
> I'm sorry I forgot that, so you need another function to store
> it as a polygon...
> 
> With postgis-1.0 you can use MakePolygon(ExteriorRing(...)).
> With postgis-0.x I'm afraid you have no easy way (but other
> users might give you better suggestions)
> 

Maybe using astext(ExteriorRing(...)) and the "substr" String function to
generate a polygon textual representation from the linestring, by removing
the "LINESTRING" keyword and replacing it with the "POLYGON" one and the
extra set of parentheses. something like:

geometryFromText('POLYGON(' || substr(astext(exteriorRing(...)), 10) || ')',
<srid>)

Nicolas Ribot
-------------- next part --------------
---------------------------------------------------------

CE COURRIER ELECTRONIQUE EST A USAGE STRICTEMENT INFORMATIF ET NE SAURAIT ENGAGER DE QUELQUE MANIERE QUE CE SOIT EADS ASTRIUM SAS, NI SES FILIALES.

SI UNE ERREUR DE TRANSMISSION OU UNE ADRESSE ERRONEE A MAL DIRIGE CE COURRIER, MERCI D'EN INFORMER L'EXPEDITEUR EN LUI FAISANT UNE REPONSE PAR COURRIER ELECTRONIQUE DES RECEPTION. SI VOUS N'ETES PAS LE DESTINATAIRE DE CE COURRIER, VOUS NE DEVEZ PAS L'UTILISER, LE CONSERVER, EN FAIRE ETAT, LE DISTRIBUER, LE COPIER, L'IMPRIMER OU EN REVELER LE CONTENU A UNE TIERCE PARTIE.



This email is for information only and will not bind EADS Astrium SAS in any contract or obligation, nor its subsidiaries.

If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it.

---------------------------------------------------------


More information about the postgis-users mailing list