| 957 | } |
| 958 | |
| 959 | static int loadGrid( layerObj *pLayer ) |
| 960 | { |
| 961 | for(;;) { |
| 962 | switch(msyylex()) { |
| 963 | case(EOF): |
| 964 | msSetError(MS_EOFERR, NULL, "loadGrid()"); |
| 965 | return(-1); |
| 966 | case(END): |
| 967 | return(0); |
| 968 | case(GRID): |
| 969 | break; /* for string loads */ |
| 970 | case( LABELFORMAT ): |
| 971 | if(getString(&((graticuleObj *)pLayer->layerinfo)->labelformat) == MS_FAILURE) { |
| 972 | if(strcasecmp(msyystring_buffer, "DD") == 0) /* DD triggers a symbol to be returned instead of a string so check for this special case */ |
| 973 | ((graticuleObj *)pLayer->layerinfo)->labelformat = msStrdup("DD"); |
| 974 | else |
| 975 | return(-1); |
| 976 | } |
| 977 | break; |
| 978 | case( MINARCS ): |
| 979 | if(getDouble(&((graticuleObj *)pLayer->layerinfo)->minarcs) == -1) |
| 980 | return(-1); |
| 981 | break; |
| 982 | case( MAXARCS ): |
| 983 | if(getDouble(&((graticuleObj *)pLayer->layerinfo)->maxarcs) == -1) |
| 984 | return(-1); |
| 985 | break; |
| 986 | case( MININTERVAL ): |
| 987 | if(getDouble(&((graticuleObj *)pLayer->layerinfo)->minincrement) == -1) |
| 988 | return(-1); |
| 989 | break; |
| 990 | case( MAXINTERVAL ): |
| 991 | if(getDouble(&((graticuleObj *)pLayer->layerinfo)->maxincrement) == -1) |
| 992 | return(-1); |
| 993 | break; |
| 994 | case( MINSUBDIVIDE ): |
| 995 | if(getDouble(&((graticuleObj *)pLayer->layerinfo)->minsubdivides) == -1) |
| 996 | return(-1); |
| 997 | break; |
| 998 | case( MAXSUBDIVIDE ): |
| 999 | if(getDouble(&((graticuleObj *)pLayer->layerinfo)->maxsubdivides) == -1) |
| 1000 | return(-1); |
| 1001 | break; |
| 1002 | default: |
| 1003 | msSetError(MS_IDENTERR, "Parsing error near (%s):(line %d)", "loadGrid()", msyystring_buffer, msyylineno); |
| 1004 | return(-1); |
| 1005 | } |
| 1006 | } |
| 1007 | } |
| 1008 | |
| 1009 | static void writeGrid(FILE *stream, int indent, graticuleObj *pGraticule) |
| 1010 | { |
no test coverage detected