Tag Archives: GIS

Jenk’s Natural Breaks Optimization

A co-worker was interested in segmenting a list of data points, and I went down a rabbit hole on one dimensional segmentation. I found an article on the Jenk’s natural breaks optimization on Wikipedia. I found another article that had some examples. This is used to bin data points so that clusters are always binned together. There is an iterative method that takes unordered data, but this implementation just sorts the data before binning.

Continue reading Jenk’s Natural Breaks Optimization

Coordinate Reference System Transformations in Javascript

Yes, you can do coordinate reference system transformations in Javascript. (I know, I’m shocked also.) I found proj4js on GitHub, which is a port of an older project, PROJ.4. The proj4js library is very easy to use. All you need to do is find the specification strings at spatialrerefence.org of the two projections/datums you are interested in and you’re ready to go.

Continue reading Coordinate Reference System Transformations in Javascript

Adding Data Points to Shapefiles

In this post I’ll discuss how to plot data points on a shapefile. In a previous post I discussed how to install basemap using pip, the package manager for Python. Since basemap is an extension of matplotlib, we have a lot of familiar plotting functions and options at our disposal. Of particular importance is the ability to use projection data in plotting the shapefile, and plotting the data points.

Continue reading Adding Data Points to Shapefiles

Viewing Shapefiles Using Basemap in Python

I heard about a new (to me) tool for viewing shapefiles on this site. It required the installation of basemap which is a part of matplotlib, but the installation turned out to be a little tricky. I found a solution at the blog, I Lessen Data, which pointed me to another interesting post on mapping, So You’d Like to Make a Map Using Python.

Continue reading Viewing Shapefiles Using Basemap in Python

Using QGIS and OSGeo4W for Geo-Data Tasks

In this post I’ll discuss creating and altering shapefiles, and converting point sets from one coordinate reference system to another. I’ll also touch on scripting these tasks for large data sets. I’ll begin with the installation of Quantum GIS and Python for manipulating geographical data. I mainly use QGIS for visualizing and building shapefiles, and I use OSGeo4W from the command line for adding/converting shapefile projections, and converting point sets from one CRS to another.

Continue reading Using QGIS and OSGeo4W for Geo-Data Tasks