How to apply spatial constraints to PostGIS tables

This article was written before TypeMod was introduced eg Geometry(Polygon,28355) As I have pointed out in other blog articles, spatial data quality should not engender either/or solutions when building business applications. That is, if I can only create points for parcel centroids that fall within land parcels, then I don’t just build the rule inRead More

Converting Oracle Optimized Rectangles to PostGIS

Someone on the PostGIS discussion list asked about a problem converting an Oracle database to PostGIS and he had run into some difficulties with Oracle’s Optimized Rectangles. Is there a way to store rectangles in postGIS in a similar fashion? With the “similar fashion” being all about converting to equivalent 5 vertex POLYGONS: I understandRead More

Building polygons from overlapping linestrings requiring intersection

I received an email a few weeks ago asking: I was wondering if you could post an article explaining how to create a polygon from overlapping lines, if this is possible. I am new as in 1 week into exploring this product and am finding the documentation for ST_BuildArea and the like a little hardRead More

DMS2DD for PostGIS

Yesterday, I posted a short article on Converting Google Earth Formatted Longitude/Latitude points to decimal degrees. The Google Earth longitude/latitude values are expressed as a string containing degree, minute and seconds values with text separators as follows: Latitude Longitude 43� 0�50.60�S 147�12�18.20�E The function described was written in PL/SQL for Oracle. Regina Obe emailed meRead More

Implementing Oracle’s GetVertices function in PostGIS – ST_DumpPoints

The GetVertices function in the MDSYS.SDO_UTIL package in Oracle Spatial is an exceedingly useful function. From the Oracle documentation of this function: This function returns an object of VERTEX_SET_TYPE, which consists of a table of objects of VERTEX_TYPE. Oracle Spatial defines the type VERTEX_SET_TYPE as: Oracle Spatial defines the object type VERTEX_TYPE as: The GetVerticesRead More

STAsEWKT

STAsEWKT — Implements an method to create Extended Well Known Text (EWKT) strings from the input @p_geometry. Introduction/Description The Open Geospatial Consortium’s, Simple Features Specifications (SFS) 1.1 and 1.2, as well as the SQL/MM standard, define a Well Known Text (WKT) format for use in interchanging or processing geometry data. These specifications are 2D inRead More