Skip to content
David Fawcett edited this page Jul 27, 2015 · 6 revisions

###5. Make sure your local repo is up to date Before you start making changes to files in your local repo, it is a good idea to make sure that it is in synch with the 'upstream' or official repo. This will reduce the number of conflicts that may pop up when your changes are merged back into the upstream repo. Note that you don't re-synch through your GitHub fork, but instead, you go directly to the upstream repo.

  • In your shell, navigate to your local repo
  • Verify that you are on the master branch using git branch. The current branch will have an asterisk next to its name.
  • Switch to the master branch if you are on it using git checkout master This should return:
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

Get the latest changes to the upstream repo git pull upstream master Which should return something like:

From https://github.com/MaptimeMSP/nacis2015-map
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> upstream/master
Already up-to-date.

Alternatively, you can use git fetch and then git merge, but pull essentially combines these two actions and works fine for our simple workflow.

###6. Add a new place of interest to the data file Take a look at the Data Notes wiki page for an explanation on how the data for our map is formatted, what the current list of place type categories are, etc.

  • Open up your local copy of nacis2015-map/js/places.geojson in your favorite text editor.
  • To add a new point, we want to add a new feature to the features list, using one of the existing features as a template.
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "title": "The Depot Renaissance Hotel",
        "address": "225 Third Ave S",
        "web": "http://thedepotminneapolis.com/",
        "poi_type": "conf",
        "scoop":"NACIS conference site"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
                        -93.26319694519043,
                         44.98044862724291
                       ]
                  }
     },
     {
      "type": "Feature",
      "properties": {
        "title": "",
        "address": "",
        "web": "",
        "poi_type": "",
        "scoop":""
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
                            ,
                         
                       ]
                  }
     }
   ]
}

Once you have the template pasted into place, fill out the properties for your new point of interest.

###7. Get the coordinates for your new place GeoJSON.io is a great tool for creating and editing GeoJSON files. To start with, we will use it in the most simple way, to grab coordinates for a point.

  • Go to GeoJSON.io and zoom in to the location where you want to create your new place of interest.
  • Click the point marker symbol on the map draw menu and then click the map where you want to place the marker.
  • This will create the most simple GeoJSON feature on the right side of the page.
{
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [
          -93.25206577777863,
          44.97646045798234
        ]
      }
    }

Copy the coordinates from the page and paste them into the data feature that you are adding to js/places.geojson.

###8. Validate the edited data file Hand crafting JSON files can be kind of tricky. One misplaced comma or semicolon can invalidate the whole file. Before committing your edited data file, validate the GeoJSON by pasting it in the text box at GeoJSONLint

Also, if you have created your local repo in a place on your laptop that is accessible to a local web server, you should be able to test your data and code changes on your local machine. If you can, this is a good idea!

###9. Save your file At this point, you have edited the local copy of js/places.geojson, but these changes have not been incorporated into your local Git repo (or any of the remote project repos).

Next Page: Commit Your Changes

Previous Page: Create a Local Repo

Clone this wiki locally