2014_02_21: more LA boundary progress

Manually copying and pasting 32 sets of bits of file is fraught with difficulty, as any fule kno.  So there had to be an easier way to assemble the individual LA geoJSON files into one javascript file. I did a lot of comparison of the brackets and guts of the working-so-far leaflet example and my geoJSON files. My file began with 

{
“type”: “FeatureCollection”,
“crs”: { “type”: “name”, “properties”: { “name”: “urn:ogc:def:crs:OGC:1.3:CRS84” } },
                                                                                

We only want one FeatureCollection, with 32 features for the 32 LA boundaries. So in a new laBoundaryData.js file, containing var laBoundaryData = { }; from the first LA file insert

      “type”: “FeatureCollection”,
      “crs”: {
            “type”: “name”,
            “properties”: {
                  “name”: “urn:ogc:def:crs:OGC:1.3:CRS84” } },
 
      “features”: [{
            “type”: “Feature”,
            “properties”: {
                  “NAME”: “Aberdeen City”,
                  “AREA_CODE”: “UTA”,
                  “DESCRIPTIO”: “Unitary Authority”,
                  “FILE_NAME”: “ABERDEEN_CITY”,
                  “NUMBER”: 7.0,
                  “NUMBER0”: 34.0,
                  “POLYGON_ID”: 122136.0,
                  “UNIT_ID”: 30421.0,
                  “CODE”: “S12000033”,
                  “HECTARES”: 20561.013,
                  “AREA”: 1990.394,
                  “TYPE_CODE”: “AA”,
                  “DESCRIPT0”: “CIVIL ADMINISTRATION AREA”,
                  “TYPE_COD0”: null,
                  “DESCRIPT1”: null,
                  “colour_code”:2         //BMR 2014_02_21
            },
            “geometry”: {
                  “type”: “MultiPolygon”,
                                    “coordinates”: [ [ [ [ -2.360870189456887, 57.10919031061777  ….]]]] } },

Note the comma. After it, paste { “type”: “Feature”, “properties”: ….]]]] } } from the next LA file, then add a comma. Then rinse and repeat.

Far from elegant but much easier than isolating wee bits from each file.

Advertisements

One thought on “2014_02_21: more LA boundary progress

  1. Pingback: 2014_03_04 progress re colours | Bruce's IT-ish world

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