Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
wiki:documentation:devguide:srs_module [2016/01/20 11:00] lubia [Coordinate Transformation] |
wiki:documentation:devguide:srs_module [2016/01/20 11:15] (current) lubia [Coordinate Transformation] |
||
---|---|---|---|
Line 82: | Line 82: | ||
delete geom; | delete geom; | ||
- | // ... | ||
- | } | ||
- | </code> | ||
- | |||
- | The code snippet below shows how an application can add an SRS Id, Authority code. This automatically makes the SRSID recognizable by the Converter. | ||
- | |||
- | <code cpp> | ||
- | { | ||
- | // ... | ||
- | // Adding a new SRS ID with your PROJ4 and WKT description | ||
- | // | ||
- | SpatialReferenceSystemManager::getInstance().add("SIRGAS 2000 / UTM zone 25S", | ||
- | "PROJCS[\"SIRGAS 2000 / UTM zone 25S\",GEOGCS[\"SIRGAS 2000\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_America_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.01745329251994328]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-33],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],UNIT[\"metre\",1]]", | ||
- | "+proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", | ||
- | 31985); | ||
- | converter->setSourceSRID(31985); | ||
- | converter->setTargetSRID(4326); | ||
- | |||
- | xyX = 500000 * 0.001; // meter to kilometer | ||
- | xyY = 10000000 * 0.001; // meter to kilometer | ||
- | |||
- | converter->convert(xyX,xyY,llX,llY); | ||
// ... | // ... | ||
} | } |