** msPostGISBuildSQLFrom() ** ** Returns malloc'ed char* that must be freed by caller. */
| 1796 | ** Returns malloc'ed char* that must be freed by caller. |
| 1797 | */ |
| 1798 | char *msPostGISBuildSQLFrom(layerObj *layer, rectObj *rect) { |
| 1799 | char *strFrom = 0; |
| 1800 | msPostGISLayerInfo *layerinfo; |
| 1801 | |
| 1802 | if (layer->debug) { |
| 1803 | msDebug("msPostGISBuildSQLFrom called.\n"); |
| 1804 | } |
| 1805 | |
| 1806 | assert( layer->layerinfo != NULL); |
| 1807 | |
| 1808 | layerinfo = (msPostGISLayerInfo *)layer->layerinfo; |
| 1809 | |
| 1810 | if ( ! layerinfo->fromsource ) { |
| 1811 | msSetError(MS_MISCERR, "Layerinfo->fromsource is not initialized.", "msPostGISBuildSQLFrom()"); |
| 1812 | return NULL; |
| 1813 | } |
| 1814 | |
| 1815 | /* |
| 1816 | ** If there's a '!BOX!' in our source we need to substitute the |
| 1817 | ** current rectangle for it... |
| 1818 | */ |
| 1819 | strFrom = msPostGISReplaceBoxToken(layer, rect, layerinfo->fromsource); |
| 1820 | |
| 1821 | return strFrom; |
| 1822 | } |
| 1823 | |
| 1824 | /* |
| 1825 | ** msPostGISBuildSQLWhere() |
no test coverage detected