Commits on Jul 15, 2016
  1. @dracos
  2. @dracos

    Switch api-docs ID to sidebar class for other use.

    dracos committed Jul 8, 2016
Commits on Jul 6, 2016
  1. @zarino @dracos
Commits on Jun 7, 2016
  1. @dracos
Commits on May 31, 2016
  1. @dracos

    Add packages files for jessie and xenial.

    Drop squeeze.
    dracos committed May 31, 2016
  2. @dracos
Commits on May 27, 2016
  1. @mhl

    Add documentation for the /code API endpoint

    This has been usable since fd959bc in June 2012, but has never been
    documented on the front page guide to the API.  This adds such
    documentation, with examples and explanation of the code types for
    the UK and Global.
    mhl committed May 27, 2016
  2. @mhl
  3. @dracos

    Merge branch 'mysoc-footer'

    dracos committed May 27, 2016
  4. @dracos

    Move to using libsass.

    This means we don't have to worry about whether sass has been installed.
    dracos committed May 27, 2016
  5. @zarino @dracos

    Implement standard mySociety footer.

    Fixes mysociety/mapit.mysociety.org#17.
    
    Requires Sass 3.2 or greater, since it uses `%` placeholder
    selectors.
    zarino committed with dracos May 11, 2016
  6. @dracos

    [UK] May 2016 Boundary-Line import.

    Deal with the Welsh Assembly boundary issues caused by new data being
    provided too early, a returning parish council that presumably should
    not have been deleted, and a duplicate unit ID.
    dracos committed May 25, 2016
Commits on May 25, 2016
  1. @dracos

    [SE] flake8 fixes.

    dracos committed May 25, 2016
  2. @dracos
  3. @dracos

    Merge branch 'reverse-fix'

    dracos committed May 25, 2016
Commits on May 18, 2016
  1. @dracos

    Add postgresql to SysV init script.

    Fixes #234.
    dracos committed May 18, 2016
  2. @zarino @dracos

    Add VagrantFile and instructions for development.

    Use install-as-user script to set up general.yml, database etc.
    Make the virtualenv self-activate on login.
    zarino committed with dracos May 11, 2016
Commits on May 6, 2016
  1. @dracos

    Fix reversing of ONS coded polygon URLs.

    d692d27 broke the reversing of polygon (kml/geojson/wkt) area
    URLs when given with an ONS or GSS code.
    dracos committed May 6, 2016
  2. @symroe @dracos
  3. @dracos

    flake8 fixes.

    dracos committed May 6, 2016
Commits on Apr 20, 2016
  1. @dracos
  2. @dracos
  3. @dracos

    Allow name_field to specify multiple options.

    This allows you to import multiple files, which use different fields to
    store the name (e.g. the OS 2016 forward dated ward polygons).
    dracos committed Apr 20, 2016
Commits on Apr 13, 2016
  1. @dracos
Commits on Apr 5, 2016
  1. @mhl

    Use reverse so more redirects work when MapIt is mounted on a subpath

    If you've included MapIt in another Django project, e.g. with:
    
        urlpatterns += patterns('',
            (r'^mapit/', include('mapit.urls')),
        )
    
    ... then some of the views that returned a redirect to a URL
    constructed with string formatting would redirect to a path
    that didn't include the 'mapit/' prefix.  If these paths are
    constructed with reverse() instead, it works properly.
    
    This also introduces some new URL pattern names, so the URL
    patterns can be referred to more concisely.
    mhl committed Feb 23, 2016
  2. @dracos

    Move October 2015 Boundary-Line patch to main.

    Otherwise you can't import this to a fresh database and get the patch
    fixes (as the control file requires previous data).
    dracos committed Apr 5, 2016
Commits on Apr 1, 2016
  1. @issyl0 @dracos

    Allow updating locationless postcodes

    - We needed to import a postcode apparently without a location, and
      the import was failing on this one specific postcode (HD7 9AS)
      because `pc.location` was blank. We've made this check more robust,
      and in the case where a postcode is blank, we've saved it anyway
      with the `location` data that comes from the file.
    issyl0 committed with dracos Mar 7, 2016
  2. @sihugh

    Allow overriding of email subject prefix

    In GOV.UK we want to specify different email subject lines for MapIt emails in
    each environment.  This change allows the EMAIL_SUBJECT_PREFIX to be set in
    general.yml.
    
    The space after the closing ']' in the example is intentional in order to
    format the full email subject nicely when it includes following text.
    sihugh committed Apr 1, 2016
Commits on Feb 10, 2016
  1. @dracos

    [UK] For NIE areas, allow import via name match.

    If you're importing to an empty database, there's no problem, but you
    might be importing into a database that already has NIE areas in it and
    don't want to create new ones simply to add the new boundaries. These
    are unable to match via ONS code, so instead allow a match on name for
    NIE boundaries only.
    dracos committed Feb 10, 2016
  2. @h-lame @dracos

    [UK] Add script for adding names to NI Areas

    The names in the OSNI data don't always match the names for the same
    areas in the ni-electoral-areas-2015.csv fixture which was extracted from
    the legislation.  In some cases it's just an uppercase difference, or a
    lack of punctuation.  In others the names are completely different.  For
    example in the fixture GSS N09000011 is called "North Down and Ards" but
    in the OSNI shapefile it is called "East Coast".  Turns out this is
    because the council voted to change the name to the OSNI one, but backed
    down after outcry and reverted[1].
    
    This script goes through the fixture and matches on GSS code to find the
    Areas and add a new override name to the area if the fixture name is not
    already present.
    
    [1]: http://www.belfasttelegraph.co.uk/news/northern-ireland/backlash-forces-council-to-ditch-new-east-coast-name-that-cost-thousands-30902221.html
    h-lame committed with dracos Dec 18, 2015
  3. @h-lame @dracos

    [UK] Add script for adding GSS codes to NI Areas

    Some mapit installations already have NI Areas with or without boundaries
    but these areas may not have GSS codes.  This script uses the
    ni-electoral-areas-2015.csv hierarchy to find LGDs, LGEs, and LGWs by
    name and add their GSS codes.  Because names are not neccessarily unique
    it respects the hierarchy in the fixture.  If names cannot be found (it
    does a case-insensitive lookup) the row is ignored and a warning issued.
    h-lame committed with dracos Dec 18, 2015
  4. @h-lame @dracos

    [UK] Provide ONSPD version of scilly command

    One command can, by checking the lengths of the rows, work on both
    Code-Point Open and ONSPD files for dealing with scilly wards.
    h-lame committed with dracos Nov 24, 2015
  5. @h-lame @dracos

    [UK] Handle NI postcodes in ONSPD importer

    We add an option to allow importing the NI postcodes at the same time as
    the rest of the postcodes.  The option takes 3 values: 'include',
    'exclude', 'only' with the same behaviour as the --crown-dependencies
    option:
    
    * 'include' will import NI postcodes
    * 'exclude' will not import NI postcodes
    * 'only' will only import NI postcodes
    
    The default is 'exclude' to maintain previous behaviour.  Unlike Crown
    Dependency postcodes NI postcodes might have location data, and so the
    --allow-no-location-postcodes setting (default false) does affect how we
    import NI postcodes.
    
    Setting both --crown-dependencies and --northern-ireland to 'only' is an
    error and will halt the importer before it begins.
    
    We've also updated the documentation provided by the options to be
    clearer about how the various options interact.
    
    Unlike the old nspd_ni importer that relied on the nspd_ni_areas
    importer to be run and the ni-electoral-areas.csv to directly assign
    areas to NI postcodes, this importer has no special handling.  We assume
    that the new OSNI importer has been run and the relevant shapefiles have
    been imported, much like we assume that the boundary-line importer has
    been run to provide the areas for the rest of the UK.
    
    You can also specify srids for GB/NI postcodes separately (with sensible
    defaults), to change the srid option on a per-row basis.
    h-lame committed with dracos Nov 25, 2015
  6. @h-lame @dracos
  7. @h-lame @dracos

    [UK] Allow specifying SRID of OSNI imports.

    From looking at the shapefiles in a viewing tool (qgis) it appears that
    the co-ords are in the NI projection (29902) in some files, but in the
    102100 projection in others. For some files this matches up with the
    arcgis metadata pointed to by the OSNI for each release (e.g. the LGEs
    dataset[1] points to the following metadata as its source[2] which lists
    29902 as the projection, and the LGW dataset[3] points to source
    metadata[4] which lists 102100 projection). For others however this is
    not true (e.g. the LGDs dataset[5] has a source metadata[6] that says
    29902, but the downloaded shapefile is actually in 102100).
    
    As it appears this is changeable per release (possibly per download) we
    allow for telling the importer what srid a given file is in. We convert
    everything to the MAPIT_AREA_SRID before import.
    
    Note that for some reason the geometry imported from the shapefiles does
    not contain an SRID for some reason so we have to set it even if we
    don't have to transform it.
    
    As a further wrinkle, PostGIS doesn't support 102100, but it is
    mathematically equivalent to 3857 which it does support. Unfortunately
    using that projection causes failures during for point-based lookup of
    parents, but if we use 4326 instead it works. Apparently 102100 and 4326
    are both "web mercator" projections so are probably very similar (if not
    exactly mathematically equivalent). Interestingly opening a shapefile
    that is in 102100 in a viewing tool such as qgis reports it as 4326
    whereas a 29902 reports as a custom projection that is identical in all
    but name to 29902. This suggests it's safe to use 4326 as a replacement
    for 102100.
    
    The defaults we set for the options are based on the SRIDs of the data
    files we've downloaded in Dec 2015 - they may change over time.
    
    [1]: http://osni.spatial-ni.opendata.arcgis.com/datasets/981a83027c0e4790891baadcfaa359a3_4
    [2]: https://gisservices.spatialni.gov.uk/arcgisc/rest/services/OpenData/OSNIOpenData_LargescaleBoundaries/MapServer/4
    [3]: http://osni.spatial-ni.opendata.arcgis.com/datasets/55cd419b2d2144de9565c9b8f73a226d_0
    [4]: https://services3.arcgis.com/dNsInyVNGMqG1QjF/arcgis/rest/services/OSNI_Open_Data_Largescale_Boundaries_Wards_2012/FeatureServer/0
    [5]: http://osni.spatial-ni.opendata.arcgis.com/datasets/a55726475f1b460c927d1816ffde6c72_2
    [6]: https://gisservices.spatialni.gov.uk/arcgisc/rest/services/OpenData/OSNIOpenData_LargescaleBoundaries/MapServer/2
    h-lame committed with dracos Dec 10, 2015