| 199 | |
| 200 | |
| 201 | pdal::SpatialReference PgReader::fetchSpatialReference() const |
| 202 | { |
| 203 | // Fetch the WKT for the SRID to set the coordinate system of this stage |
| 204 | log()->get(LogLevel::Debug) << "Fetching SRID ..." << std::endl; |
| 205 | |
| 206 | uint32_t pcid = fetchPcid(); |
| 207 | |
| 208 | std::ostringstream oss; |
| 209 | oss << "SELECT srid FROM pointcloud_formats WHERE pcid = " << pcid; |
| 210 | |
| 211 | std::string srid_str = pg_query_once(m_session, oss.str()); |
| 212 | if (srid_str.empty()) |
| 213 | throwError("Unable to fetch srid for this table and column"); |
| 214 | |
| 215 | int32_t srid = atoi(srid_str.c_str()); |
| 216 | log()->get(LogLevel::Debug) << " got SRID = " << srid << std::endl; |
| 217 | |
| 218 | oss.str(""); |
| 219 | oss << "EPSG:" << srid; |
| 220 | |
| 221 | if (srid >= 0) |
| 222 | return pdal::SpatialReference(oss.str()); |
| 223 | else |
| 224 | return pdal::SpatialReference(); |
| 225 | } |
| 226 | |
| 227 | |
| 228 | void PgReader::ready(PointTableRef /*table*/) |
nothing calls this directly
no test coverage detected