MCPcopy Create free account
hub / github.com/OSGeo/gdal / SetProjCS

Method SetProjCS

ogr/ogrspatialreference.cpp:5796–5824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5794 */
5795
5796OGRErr OGRSpatialReference::SetProjCS(const char *pszName)
5797
5798{
5799 TAKE_OPTIONAL_LOCK();
5800
5801 d->refreshProjObj();
5802 d->demoteFromBoundCRS();
5803 if (d->m_pjType == PJ_TYPE_PROJECTED_CRS)
5804 {
5805 d->setPjCRS(proj_alter_name(d->getPROJContext(), d->m_pj_crs, pszName));
5806 }
5807 else
5808 {
5809 auto dummyConv = proj_create_conversion(d->getPROJContext(), nullptr,
5810 nullptr, nullptr, nullptr,
5811 nullptr, nullptr, 0, nullptr);
5812 auto cs = proj_create_cartesian_2D_cs(
5813 d->getPROJContext(), PJ_CART2D_EASTING_NORTHING, nullptr, 0);
5814
5815 auto projCRS = proj_create_projected_crs(
5816 d->getPROJContext(), pszName, d->getGeodBaseCRS(), dummyConv, cs);
5817 proj_destroy(dummyConv);
5818 proj_destroy(cs);
5819
5820 d->setPjCRS(projCRS);
5821 }
5822 d->undoDemoteFromBoundCRS();
5823 return OGRERR_NONE;
5824}
5825
5826/************************************************************************/
5827/* OSRSetProjCS() */

Callers 14

importProjCSFromXMLFunction · 0.80
OSRSetProjCSFunction · 0.80
IdrisiGeoReference2WktFunction · 0.80
OpenMethod · 0.80
CaptureCSKGeolocationMethod · 0.80
gt_wkt_srs.cppFile · 0.80
HFAPCSStructToOSRFunction · 0.80
OpenMethod · 0.80
ReadGeoreferencingMethod · 0.80
OpenMethod · 0.80

Calls 6

refreshProjObjMethod · 0.80
demoteFromBoundCRSMethod · 0.80
setPjCRSMethod · 0.80
getPROJContextMethod · 0.80
getGeodBaseCRSMethod · 0.80

Tested by 1