[postgis-devel] Creating a POINTARRAY, what's the best way?

Jorge Arévalo jorge.arevalo at deimos-space.com
Thu May 26 14:28:22 PDT 2011


Hi,

On Thu, May 26, 2011 at 10:28 PM, Paul Ramsey <pramsey at opengeo.org> wrote:
> Hi,
>
> 2011/5/26 Jorge Arévalo <jorge.arevalo at deimos-space.com>:
>>
>> Looking at liblwgeom code, I've found 2 ways of creating a POINTARRAY
>> object from a list of points:
>>
>> - ptarray_construct/ptarray_insert_point/ptarray_append_point
>> - wkt_parser_ptarray_new/wkt_parser_ptarray_add_coord
>
> The wkt_ forms are meant for use by the wkt parser, so don't use them.
> You'll note they aren't defined in liblwgeom.h. In a Glorious Future,
> only public API calls will be there, and internal ones will be in
> liblwgeom_internal.h
>

Ok, I've used ptarray_construct and ptarray_append_point to construct
POINTARRAYS.


>> Apart from this, I see "POINT" objects defined in 3 ways:
>>
>> - POINT(flags, x, y, z, m) in lwin_wkt.h
>> - POINT2D/POINT3DZ/POINT3D/POINT3DM/POINT4D in liblwgeom.h
>> - LWPOINT(type, flags, bbox, srid, point) in liblwgeom.h.
>>
>> The difference between the two last types of points is clear (a
>> "light-weight point" stores more info than simply coords), but what's
>> the difference between "POINT" and "POINT4D". They're equal. What
>> should I use?
>
> For now, use POINT4D. The idea of POINT is to have a POINT that is
> generic and contains information about the expected dimensionality.
> But we seem to have gotten by for the most part with POINT4D in the
> past, and the generic POINT is not used anywhere at this point (and
> might never be).
>

Fine, I've used it.

Many thanks!

Jorge

> P.
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>



-- 
Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge.arevalo at deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g



More information about the postgis-devel mailing list