Skip to content

Make datasource info available as python objects #171

Closed
artemp opened this Issue Oct 11, 2011 · 6 comments

2 participants

@artemp
Mapnik member
artemp commented Oct 11, 2011

To avoid this kind of monkeypatching to parse the string returned from lyr.describe():

http://mapnik-utils.googlecode.com/svn/trunk/nikinfo/nikinfo.py

a more pythonic interface to be exposed to a layers datasource.

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] essentially I think a list of fields should be exposed, as well as the name/type of the datasource and the encoding.

Further, datasource specific parameters can be exposed in the params object (once we get that working via python #330).

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] added in r1121

you can now do:
{{{
(Pdb) ds.fields()
'FIPS', 'ISO2', 'ISO3', 'UN', 'NAME', 'AREA', 'POP2005', 'REGION', 'SUBREGION', 'LON', 'LAT' ds.field_types()
, , , , , , , , , , ds.name()
'shape'
(Pdb) ds.encoding()
'utf-8'

}}}

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] changing milestone... going to be part of 0.6.1 release

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] this could use a review before the 0.6.1 release, so re-opening....

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] r1162 added/exposed params() methods, also needs review/improvement

@artemp
Mapnik member
artemp commented Oct 11, 2011

[springmeyer] leaving open and moving to 0.6.2 for further review

@springmeyer springmeyer closed this Sep 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.