예제 #1
0
void Reader::initialize()
{
    pdal::Reader::initialize();

    std::string const& query = getOptions().getValueOrThrow<std::string>("query");
    std::string const& connection = getOptions().getValueOrThrow<std::string>("connection");


    m_session->set_log_stream(&(log()->get(logDEBUG2)));

    m_schema = fetchSchema(query);

    try
    {
        setSpatialReference(getOptions().getValueOrThrow<pdal::SpatialReference>("spatialreference"));

    }
    catch (pdal::option_not_found const&)
    {
        // If one wasn't set on the options, we'll ignore at this
        setSpatialReference(fetchSpatialReference(query));

    }

}
예제 #2
0
void PgReader::ready(PointTableRef /*table*/)
{
    m_atEnd = false;
    m_cur_row = 0;
    m_cur_nrows = 0;
    m_cur_result = NULL;

    if (getSpatialReference().empty())
        setSpatialReference(fetchSpatialReference());

    CursorSetup();
}
예제 #3
0
파일: PgReader.cpp 프로젝트: rskelly/PDAL
void PgReader::ready(PointContextRef ctx)
{
    m_atEnd = false;
    m_cur_row = 0;
    m_cur_nrows = 0;
    m_cur_result = NULL;

    if (getSpatialReference().empty())
        setSpatialReference(fetchSpatialReference());

    m_point_size = 0;
    for (auto di = m_dims.begin(); di != m_dims.end(); ++di)
        m_point_size += Dimension::size(di->m_dimType.m_type);

    CursorSetup();
}