ST_BUFFER_METERS: The PostGIS function you didn’t know you needed

After spending the better part of the day trying to get my projections right so I could draw a 100 meter buffer around points for 311 noise complaints for bars, clubs, and restaurants in New York City, I found these gems I’d like to share:

They come from GIS Tutor and were a lifesaver.  ST_BUFFER is usually my friend, but casting the geometry to a geography (see my post on the difference) and asking for 100 meters wasn’t working. This did the trick. Hopefully it’ll be a part of the new PostGIS Add-ons, if it hasn’t been added already.

2015-09-23 Update: I recently discovered I could easily embed a Github Gist into my blog posts and have started doing this for all my posts. I replaced the images I had here previously with the code gists so readers can copy and paste the code. 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s