This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
on 12-07-202009:34 AM - edited on 12-07-202009:34 AM by HenrietteH
How To: Write Spatial Data to PostgreSQL
Spatial data is stored in a PostgreSQL database a little differently than one might expect -- the information is stored as strings! Luckily, Alteryx Designer already has all the tools needed to flip the spatial data field into a string field and format it properly in order to be stored in PostgreSQL.
Ensure that your field mappings are correct – seems to work best when your spatial (now string type field) field is the same name as the spatial field in PostgreSQL. Field mappings are a little easier if the naming convention is the same between the output and the target table.
In the OUTPUT settings in Designer, you will not be able to specify the spatial object field (line 12) because your spatial data coming out of Designer will now be STRING format.
There is a LINE and a LSEG datatype… Line follows a mathematical model that is functionally useless for most applications of geography (represents an infinite line).
There is a BOX type as well that takes pairs of coordinates (opposite corners of the box). My example above for polygon is technically a box, but seems to work fine as a polygon…
The UID (primary key/unique ID) is not necessary, but recommended