Ticket #13267: gis_tutorial_update.diff

File gis_tutorial_update.diff, 1.2 KB (added by samueladam, 5 years ago)

gis tutorial examples, minor fixes

  • docs/ref/contrib/gis/tutorial.txt

     
    342342Now, the world borders shapefile may be opened using GeoDjango's
    343343:class:`~django.contrib.gis.gdal.DataSource` interface::
    344344
    345     >>> from django.contrib.gis.gdal import *
     345    >>> from django.contrib.gis.gdal.datasource import DataSource
    346346    >>> ds = DataSource(world_shp)
    347347    >>> print ds
    348348    / ... /geodjango/world/data/TM_WORLD_BORDERS-0.3.shp (ESRI Shapefile)
     
    459459        'subregion' : 'SUBREGION',
    460460        'lon' : 'LON',
    461461        'lat' : 'LAT',
    462         'mpoly' : 'MULTIPOLYGON',
     462        'geom' : 'MULTIPOLYGON',
    463463    }
    464464
    465465    world_shp = os.path.abspath(os.path.join(os.path.dirname(__file__), 'data/TM_WORLD_BORDERS-0.3.shp'))
     
    468468        lm = LayerMapping(WorldBorders, world_shp, world_mapping,
    469469                          transform=False, encoding='iso-8859-1')
    470470
    471         lm.save(strict=True, verbose=verbose)
     471        lm.save(strict=True, verbose=True)
    472472
    473473A few notes about what's going on:
    474474
Back to Top