Importing GeoJSON data into MongoDB

Update 5/1/15 - On a different instance of Mongo, I had run the command noted below and got errors. However, this worked:

mongoimport --db mean-dev -c points --file "points.geojson" --jsonArray

 

Let me save you the hours lost in trying to figure out getting GeoJSON features into individual documents in a collection versus one document with nested features.

MongoDB 3.0.2. Valid GeoJSON file full of 809 features.

Using this code:

mongoimport --db test --type json --file ./'mobilemaps.geojson' 

Travel in 2014

Before I forget too much of 2014, I thought I'd write down some of the cool travel we did last year.

We started with a trip to Miami and Key West in late December through early January. We hung out at the Fontainbleu and the Southernmost House. Warm, good food, lots of exercise.

In late March through early April, we went to London for 10 days. Lnda's had a Courseara conference. I walked around the city listening to Elvis Costello, The Clash, Cream, Jeff Beck and others, seeing the sights and acting as support for Lynda and Lauren Butler

Extending the MEAN Stack Example

One thing that has been frustrating me in learning the MEAN stack has been how to extend the basic Article example (or a CRUD created module) beyond the basic data model. While you're trying to learn AngularJS and Mongoose/MongoDB interactions, you can find lots of literature on modelling, but little on how to modify your core CRUD views, model and controllers to work together. I'm sure that there may/are better and more elegant ways to accomplish this.

Importing Data - MongoDB

Importing to Mongo via jsonArray
mongoimport -d meanjs-leaflet4-dev -c leaflets -f name,coordinates --type json --file building-addresses.json --jsonArray
 
// sample file
// notes - coordinates needs to be bracketed to indicate an array otherwise we get string
// created - use a yyyy-mm-dd for basic entry
    [
    {
      "name": "Cowell College - Apartment  2",

Getting MEAN with Leaflet Markers

Over the past week, in between meetings, I've gotten some additional functionality added. I've been able to enter a number of Leaflet nodes (records) and then display markers on the "list" view. I've created a link in the popup that then takes us to the detail record. I've also been taking Dan Whalin's Udemy course. His site has a 50% off coupon code.

The MEAN Stack and Leaflet - My Notes

I've been looking at how to refactor our campus maps app from being Drupal based to sometihng that is based on a RESTful API so that data can be easily shared with other apps. Drupal has gotten us a long way, but the map stack of modules we're using has some limitations. I need to pull some custom map work stored at Mapbox.com giving us deeper zooms and styling rules we've decided upon.

The MEAN stack offers one refactoring option. So, I spent Christmas vacation doing some reading, configuring and thinking about how the MEAN stack might work for our needs.

SmartOS, PostgreSQL, PostGIS, Imposm, Osmosis, Osm2Postgres

I'm still getting up to speed with SmartOS. Here are some notes I took while trying to get PostgreSQL on SmartOS to parse OpenStreetMap (osm) files. My intent is to use Mapbox Studio to do some custom styling for OSM as we develop some "single purpose" maps.

Here's the summary I wrote at LAX when I came home from MMWCON down at UCLA in September 2014.

I was ultimately successful in getting data parsed in the VM and can use Mapbox Studio to connect and style the maps. Now to find some time to finish that little project...

 

Mr. Mac

Mr. Mac starts school 1989

Dad passed away this past Saturday, February 22 at 10:44.

I'd been taking care of him these past few years. I was with him when he passed. 

The past few years had been hard. He'd been getting weaker and his cognition worse. But we found some fun to have this past year. 

In early summer, I took a week off and loaded him in the truck each day. We went to my office BBQ out at DeLavega, ate some Betty burgers, checked the surf and drove through the neigborhoods he knew as a boy.

Tom McMillan - 11/17/1934 - 2/22/2014

Mr. Mac

Tom McMillan, much loved husband, father, brother and 6th grade teacher passed away on Saturday, February 22, 2014.

Tom was born to Ross and Shirley McMillan at the Old Sister’s hospital (now a parking lot across from Dream Inn) in November of 1934.  He was the oldest of three with 2 younger sisters, Nancy and Mary.  Tom enjoyed Scouts and as a young boy he loved the freedom he found in Santa Cruz where could ride his bike all around town and fish off the wharf at night. 

Using Yeoman for a Dining App

I got turned on to Yeoman back at the Modern Mobile Conference back in September.

In October, I started working with Yeoman to build up a small mobile Bootstrap based site of a dozen pages or so. My objective is to use a team of students to help with development, keep the app as browser-based and make it work on mobile devices. 

The plan is to integrate some simple features. These include:

  • leaflet
  • leaflet-hash
  • leaflet-locatecontrol
  • touchSwipe
  • handlebars

Here's some notes on how this project is progressing.

OSM data and TileMill

I started with the TileMill support docs (Crash Course and Guides) to get my basic info and configurations. This is some of the best support documentation I've seen. Well written in a step-by-step approach. Admittedly, I need to re-read some sections until it sunk in, but after seeing some demo's by @springmeyer and @ian_villeda at SOTMUS, it started to become more clear.

Integrating OSM, TileMill, MapBox and Drupal

After attending the State of the Map (SOTMUS) conference last week, I started working on a project I had been thinking about for some time. I'd been particularly interested in figuring out how to use TileMill to style or override data coming from OpenStreetMap. Beyond that, I've been trying to figure out how all the different components would fit together. I should note that I'm not a cartographer, I'm just into mapping and the technology.

The Setup

XCode Tip - Orientation

After struggling for a few days thinking that my jQuery code was somehow wrong, I found that I hadn't selected the various "supported device orientation" icons in my proejcts' target screen. 

To navigate to the this window, select the project, find the 4 icons and select away. While you're there, setup an App Icon and Launch Images.