Shapefiles to MongoDB with Ruby
Shapefiles at census.gov download as .zip files unzip to .shp convert to geojson as .json files import to MongoDB as Shapes with proper coordinates. Shapefile.find(id).to_json => geojson geospatially index the files and perform the following searches:
shapes and places near a point polygons that apply to a point
For the project, I'm using nofxx-georuby gem
MongoDB some custom ruby code that I'm using to plumb this through
To create a geospatial index with mongo, if :coordinates is an array of [lat,lng] arrays, it can be indexed as coordinates : "2d".
By Ryan Wold · © 2012–2026 Ryan Wold
Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.
Tip: $afomi on HandCash · afomi@handcash.io