MCPcopy Create free account
hub / github.com/MapServer/MapServer / msGEOSShape2Geometry_line

Function msGEOSShape2Geometry_line

mapgeos.c:111–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111static GEOSGeom msGEOSShape2Geometry_line(lineObj *line)
112{
113 int i;
114 GEOSGeom g;
115 GEOSCoordSeq coords;
116
117 if(!line) return NULL;
118
119 coords = GEOSCoordSeq_create(line->numpoints, 2); /* todo handle z's */
120 if(!coords) return NULL;
121
122 for(i=0; i<line->numpoints; i++) {
123 GEOSCoordSeq_setX(coords, i, line->point[i].x);
124 GEOSCoordSeq_setY(coords, i, line->point[i].y);
125 /* GEOSCoordSeq_setZ(coords, i, line->point[i].z); */
126 }
127
128 g = GEOSGeom_createLineString(coords); /* g owns the coordinates in coords */
129
130 return g;
131}
132
133static GEOSGeom msGEOSShape2Geometry_multiline(shapeObj *multiline)
134{

Callers 2

msGEOSShape2GeometryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected