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

Function loadFeaturePoints

mapfile.c:806–839  ·  view source on GitHub ↗

lineObj = multipointObj */

Source from the content-addressed store, hash-verified

804
805/* lineObj = multipointObj */
806static int loadFeaturePoints(lineObj *points)
807{
808 int buffer_size=0;
809
810 points->point = (pointObj *)malloc(sizeof(pointObj)*MS_FEATUREINITSIZE);
811 MS_CHECK_ALLOC(points->point, sizeof(pointObj)*MS_FEATUREINITSIZE, MS_FAILURE);
812 points->numpoints = 0;
813 buffer_size = MS_FEATUREINITSIZE;
814
815 for(;;) {
816 switch(msyylex()) {
817 case(EOF):
818 msSetError(MS_EOFERR, NULL, "loadFeaturePoints()");
819 return(MS_FAILURE);
820 case(END):
821 return(MS_SUCCESS);
822 case(MS_NUMBER):
823 if(points->numpoints == buffer_size) { /* just add it to the end */
824 points->point = (pointObj *) realloc(points->point, sizeof(pointObj)*(buffer_size+MS_FEATUREINCREMENT));
825 MS_CHECK_ALLOC(points->point, sizeof(pointObj)*(buffer_size+MS_FEATUREINCREMENT), MS_FAILURE);
826 buffer_size+=MS_FEATUREINCREMENT;
827 }
828
829 points->point[points->numpoints].x = atof(msyystring_buffer);
830 if(getDouble(&(points->point[points->numpoints].y)) == -1) return(MS_FAILURE);
831
832 points->numpoints++;
833 break;
834 default:
835 msSetError(MS_IDENTERR, "Parsing error near (%s):(line %d)", "loadFeaturePoints()", msyystring_buffer, msyylineno );
836 return(MS_FAILURE);
837 }
838 }
839}
840
841static int loadFeature(layerObj *player, int type)
842{

Callers 1

loadFeatureFunction · 0.85

Calls 2

msSetErrorFunction · 0.85
getDoubleFunction · 0.85

Tested by

no test coverage detected