PostGIS – a leading open source spatial database – has made significant strides in recent releasesPostGIS – a leading open source spatial database – has made significant strides in recent releases, including support for a round-earth model, better performance, and more complete support for curves. This week at FOSS4G, participants will explore how best to leverage these capabilities and look ahead to new ones, along with other open source geospatial technologies. So, this seemed a fitting time to reflect on a few of these new features.

Geography
When spatial data spans a large area, it’s often stored in latitude/longitude (with an appropriate regional or global datum). Effectively using this data requires a round-earth approach — otherwise areas and distances don’t make sense and you run into discontinuities around the poles and 180° meridian. With its new Geography type, PostGIS can store, query, and manipulate spatial data in a round-earth way. Two approaches are used: Some calculations (e.g., distance and area) are calculated mathematically, and others (e.g., buffer and intersection) are approximated via local, flat coordinate systems.

Curves
The SQL/MM-3 standard (which overlaps somewhat with OGC’s Simple Features Architecture) defines Well Known Text and Binary representations for curved paths and areas. It includes CircularStrings (sequences of circular arcs), CompoundCurves (sequences of circular arcs and lines), and CurvePolygons (areas bounded by curved paths); PostGIS supports all of the above.

One interesting limitation is that you can constrain a geometry column to a specific type (e.g. all Linestrings or all CircularStrings) but not to a generic type (e.g. all linear or all area geometries). This surprised me as I could imagine datasets containing a mix of lines and arcs (constraint to type Curve, unsupported), but couldn’t imagine many datasets consisting of all arcs and no lines (constraint to type CircularString, supported). This led me to challenge my earlier assumption that users frequently used geometry type constraints – is it that few users are interested in curves, or that few users are interested in geometry type constraints? I’d love to hear from you: How often do you constrain geometry columns to specific types? Are you using curved data? Does this limitation matter to you?

Community and Interoperability
In addition to releasing software, the PostGIS team has made significant contributions to interoperability in the wider geospatial landscape. For example, Paul Ramsey’s advocacy for the longitude/latitude ordering of geographic data (in a specific context) played a role in Microsoft’s round-earth implementation, reinforced an de facto standard, and made it easier to exchange this kind of data. I have also enjoyed Paul’s technical contributions on subjects such as “empty” geometries and challenges with round-earth data.

I’d also be remiss if I didn’t point out some new developments to how our own software (FME) works with PostGIS, including making it easy to load your data into these new PostGIS data types. Mark Ireland has a great summary of these enhancements and touches on updates to four key areas: geodetic data, Unicode, measures, and geometry model enhancements.

So I’m curious. How are you making the most of PostGIS?

About Data Open Source PostGIS Spatial Data Spatial Databases

Paul Nalos

Comments

4 Responses to “PostGIS, Curves, a Round World, and More”

  1. Finally this is supported in PostGIS. Up to date we used “compound” features in PostGIS storing the arc information as attributes (using FME to do that, basically de-constrcuting the arcs when writing and re-constructing them when reading the data – to my surprise it worked). Unfortunately the support of compound features in PostGIS is currenty of not too much use, as no client supports that (such as QGIS, MapServer, MapInfo and so on) …

  2. Paul Nalos says:

    Hi Flavio,

    I certainly share your excitement for the curve types in PostGIS. I can understand that your workaround of storing curves via parameters in numeric columns would not be usable in any of the GIS clients, but I’m curious what the situation is now that curves are first-class citizens.

    Do you or others know if these clients (QGIS, MapServer, MapInfo, etc.) support native PostGIS curves? A quick web search suggests this may be an area of ongoing improvement, but I haven’t experimented with these tools to be sure.

    Regards,

    Paul

  3. […] September, I talked about some of the major recent additions to PostGIS, focusing on support for curves and a round-earth model. Now, with PostGIS 2.0 perhaps […]

  4. […] the OGC model (like PostGIS), curve support comes with three new types: circular strings (sequences of circular arcs), compound […]

Leave a Reply to Paul Nalos Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts