* */
| 153 | * |
| 154 | */ |
| 155 | int msGraticuleLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) |
| 156 | { |
| 157 | graticuleObj *pInfo = (graticuleObj *) layer->layerinfo; |
| 158 | int iAxisTickCount = 0; |
| 159 | rectObj rectMapCoordinates; |
| 160 | |
| 161 | if(msCheckParentPointer(layer->map,"map") == MS_FAILURE) |
| 162 | return MS_FAILURE; |
| 163 | |
| 164 | pInfo->dstartlatitude = rect.miny; |
| 165 | pInfo->dstartlongitude = rect.minx; |
| 166 | pInfo->dendlatitude = rect.maxy; |
| 167 | pInfo->dendlongitude = rect.maxx; |
| 168 | pInfo->bvertical = 1; |
| 169 | pInfo->extent = rect; |
| 170 | |
| 171 | if( pInfo->minincrement > 0.0 ) { |
| 172 | pInfo->dincrementlongitude = pInfo->minincrement; |
| 173 | pInfo->dincrementlatitude = pInfo->minincrement; |
| 174 | } else if( pInfo->maxincrement > 0.0 ) { |
| 175 | pInfo->dincrementlongitude = pInfo->maxincrement; |
| 176 | pInfo->dincrementlatitude = pInfo->maxincrement; |
| 177 | } else { |
| 178 | pInfo->dincrementlongitude = 0; |
| 179 | pInfo->dincrementlatitude = 0; |
| 180 | } |
| 181 | |
| 182 | if( pInfo->maxarcs > 0 ) |
| 183 | iAxisTickCount = (int) pInfo->maxarcs; |
| 184 | else if( pInfo->minarcs > 0 ) |
| 185 | iAxisTickCount = (int) pInfo->minarcs; |
| 186 | |
| 187 | DefineAxis( iAxisTickCount, &pInfo->dstartlongitude, &pInfo->dendlongitude, &pInfo->dincrementlongitude); |
| 188 | DefineAxis( iAxisTickCount, &pInfo->dstartlatitude, &pInfo->dendlatitude, &pInfo->dincrementlatitude); |
| 189 | |
| 190 | pInfo->dwhichlatitude = pInfo->dstartlatitude; |
| 191 | pInfo->dwhichlongitude = pInfo->dstartlongitude; |
| 192 | |
| 193 | if( pInfo->minincrement > 0.0 && pInfo->maxincrement > 0.0 && pInfo->minincrement == pInfo->maxincrement ) { |
| 194 | pInfo->dincrementlongitude = pInfo->minincrement; |
| 195 | pInfo->dincrementlatitude = pInfo->minincrement; |
| 196 | } else if( pInfo->minincrement > 0.0 ) { |
| 197 | pInfo->dincrementlongitude = pInfo->minincrement; |
| 198 | pInfo->dincrementlatitude = pInfo->minincrement; |
| 199 | } else if( pInfo->maxincrement > 0.0 ) { |
| 200 | pInfo->dincrementlongitude = pInfo->maxincrement; |
| 201 | pInfo->dincrementlatitude = pInfo->maxincrement; |
| 202 | } |
| 203 | |
| 204 | /* |
| 205 | * If using PROJ, project rect back into map system, and generate rect corner points in native system. |
| 206 | * These lines will be used when generating labels to get correct placement at arc/rect edge intersections. |
| 207 | */ |
| 208 | rectMapCoordinates = layer->map->extent; |
| 209 | pInfo->pboundinglines = (lineObj *) msSmallMalloc( sizeof( lineObj ) * 4 ); |
| 210 | pInfo->pboundingpoints = (pointObj *) msSmallMalloc( sizeof( pointObj ) * 8 ); |
| 211 | |
| 212 | { |
nothing calls this directly
no test coverage detected