mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-25 01:22:47 +00:00
b7d587678b
git-svn-id: http://svn.osgeo.org/postgis/trunk@4494 b70326c6-7e19-0410-871a-916f4a2858ee
38 lines
1,010 B
C
38 lines
1,010 B
C
/**********************************************************************
|
|
* $Id$
|
|
*
|
|
* PostGIS - Spatial Types for PostgreSQL
|
|
* Copyright 2009 Paul Ramsey <pramsey@cleverelephant.ca>
|
|
*
|
|
* This is free software; you can redistribute and/or modify it under
|
|
* the terms of the GNU General Public Licence. See the COPYING file.
|
|
*
|
|
**********************************************************************/
|
|
|
|
#include "libgeom.h"
|
|
|
|
G_LINESTRING* glinestring_new_from_gptarray(GPTARRAY *ptarray)
|
|
{
|
|
G_LINESTRING *gline = NULL;
|
|
assert(ptarray);
|
|
gline = (G_LINESTRING*)lwalloc(sizeof(G_LINESTRING));
|
|
gline->flags = ptarray->flags;
|
|
gline->type = LINETYPE;
|
|
gline->bbox = NULL;
|
|
gline->srid = 0;
|
|
gline->points = ptarray;
|
|
return gline;
|
|
}
|
|
|
|
G_LINESTRING* glinestring_new(uchar flags)
|
|
{
|
|
G_LINESTRING *gline = NULL;
|
|
gline = (G_LINESTRING*)lwalloc(sizeof(G_LINESTRING));
|
|
gline->flags = flags;
|
|
gline->type = LINETYPE;
|
|
gline->bbox = NULL;
|
|
gline->srid = 0;
|
|
gline->points = gptarray_new(gline->flags);
|
|
return gline;
|
|
}
|