Using PostGIS for Hydrologic Modeling (reblog)

The Problem We have to filter out the roads and ditches without removing streams that cross roads or follow them closely. I’m going to use PostGIS to find the intersection of the streams lines data with a buffered roads polygon. If the intersected line is less than 50% of the length of the stream line, […] via Filtering Roads from Extracted Streams Data — GeoKota Continue reading Using PostGIS for Hydrologic Modeling (reblog)

Using foreign data wrapper to use PostGIS with SQLServer

Here was the problem that needed solved last week (we have a few similar problems in upcoming projects, so this was an exciting thing to try): we needed to use PostGIS to access data in a SQLServer database. The SQLServer database backs the web site in question, the underlying content management system, etc., so no– removing SQLServer isn’t really an option at this stage. Obviously … Continue reading Using foreign data wrapper to use PostGIS with SQLServer

ST_ApproximateMedialAxis(geom)

Trying out PostGIS 2.2’s ST_ApproximateMedialAxis capabilities today. I’m going to use it to label parcels. So here is my parcel fabric: And here’s what the skeleton of that fabric looks like: It get’s pretty interesting where the parcels are more complicated: more: Oh, the code you say? Well, it couldn’t be much easier: SELECT gid, ST_ApproximateMedialAxis(geom) AS geom FROM cuy_parcel_2015; Or the full version for … Continue reading ST_ApproximateMedialAxis(geom)

Quick (and likely apocryphal) post on versioning and databases

This is a quick blog post about technologies that I don’t know well… so please comment if you know better. GeoGig and dat are great tools for addressing versioning in data, so what’s the difference? GeoGig is built on Java and meant for any “simple features” geometry (points, lines, polygons). It’s strength is that it is built from the ground up to handle geometries well, … Continue reading Quick (and likely apocryphal) post on versioning and databases

Proper (ab)use of a database, contour interpolation using #postgresql #postgis #arcgis

Anyone who has been following along at home knows I don’t think much like a DBA.  Sometimes that’s good; mostly it’s probably bad.  In this post, I hope it will be interesting. The problem of the day is how to take engineering contours derived from breaklines, a lidar point cloud, and all the lot, and do a good job interpolating that to a DEM.  This … Continue reading Proper (ab)use of a database, contour interpolation using #postgresql #postgis #arcgis

Cartography and USGS — Fake Building Footprints in PostGIS now with distance operator (part 2)

In a previous couple of posts (this one, and this one), we dealt with point rotations, first with bounding box searches, and then with nominal use of operators. First we create a function to do our angle calculations, then use select to loop through all the records and do the calculations. Within our function, first we find our first (in this case) five nearest streets … Continue reading Cartography and USGS — Fake Building Footprints in PostGIS now with distance operator (part 2)

Going deeper into web cartography: future=past? (and Swiss cartographic genius)

My favorite cartography book is Eduard Imhof’s Cartographic Relief Presentation.  A few years back I picked this book up (translated to English) from ESRI press for $75 if memory serves me.  Now it can be gotten for much cheaper. Imhof spends a lot of time on feature simplification and separation, a problem which keeps me up at night.  For example, if you have a lot … Continue reading Going deeper into web cartography: future=past? (and Swiss cartographic genius)

Cartography and USGS — Fake Building Footprints in PostGIS now with distance operator

In a previous post (I feel like I say that a lot), I wrote about rotating address points to match nearby roads in replicate the effect of USGS quads that represented small buildings with little squares that followed the nearby road alignment. The function was effective: but deadly slow when applied to all 500,000 address points. And so we iterate. First, I’ll show you our … Continue reading Cartography and USGS — Fake Building Footprints in PostGIS now with distance operator

PostGIS for Dessert: Sketching shapes in #PostGIS– compass roses revisited

For one of our applications, we need 8-point compass roses placed at each of our points, as well as a circle 40 meters in diameter as well as one 140 meters in diameter.  We did a bit of work with this a while back in GeoServer using SLDs.  Now we’d like to refine it, and implementing this in an SLD is beyond my skills. So, … Continue reading PostGIS for Dessert: Sketching shapes in #PostGIS– compass roses revisited