April 2018
Beginner to intermediate
440 pages
11h 36m
English
The data in the database is using World Geodetic System 84 (WGS 84), latitude and longitude. What if you need the data out in European Petroleum Survey Group (EPSG) 3857? You can change the spatial reference in your query using ST_Transform(). The following code shows you how by using PostGIS functions:
cursor.execute("SELECT UpdateGeometrySRID('art_pieces','location',4326)")cursor.execute("SELECT Find_SRID('public','art_pieces','location')")cursor.fetchall()
The previous code makes two queries to the database: