Ticket #113 (closed defect: fixed)

Opened 2 years ago

Last modified 20 months ago

Support adding points dynamically in Python

Reported by: lwu Owned by: artem
Priority: major Milestone: 0.6.0
Component: Boost.Python Binding Version: SVN Trunk
Severity: Normal Keywords:
Cc: Patch Needs Improvement: no
Needs Docmentation: no Has Patch?: yes
Design Decision Needed: yes

Description

Mapnik's Python binding lacks sufficient functionality to easily implement the ability to add points dynamically (programmatically) in Python.

I have attached a patch which addresses this problem, by taking the patch attached to ticket #111 and implementing a number of Python binding codes which were not yet implemented.

Programmatic addition of data points in Python seems to be a frequent request on the mailing lists, and thus this functionality seems particularly useful to support.

Attachments

python_point_datasource.patch (9.4 kB) - added by lwu 2 years ago.
Support for python-based point datasources

Change History

Changed 2 years ago by lwu

Support for python-based point datasources

Changed 2 years ago by lwu

Changed 2 years ago by springmeyer

lwu,

nice patch.

I was able to patch and rebuilt mapnik on mac 10.5 with no problems. I then downloaded your sample code and it worked perfectly.

These were my steps:

cd ~/src/mapnik-svn-trunk
wget http://trac.mapnik.org/raw-attachment/ticket/113/python_point_datasource.patch
patch -p0 -i python_point_datasource.patch # then rebuild mapnik...
cd ~/projects/mapnik-utils/trunk/sample_data
wget http://edcftp.cr.usgs.gov/pub/data/nationalatlas/statesp020.tar.gz
tar svf statesp020.tar.gz
rm statesp020.tar.gz
echo 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]' > statesp020.prj

Changed 2 years ago by springmeyer

  • priority set to major

Changed 2 years ago by springmeyer

  • patch_need_improvement unset
  • version set to SVN Trunk
  • need_documentation unset
  • milestone set to 0.5.2
  • has_patch set
  • design_decision_needed set

Changed 20 months ago by lwu

I've been working on an interactive map renderer and just realized that a variant of memory_datasource would also be useful for interactive map applications, as a way to cache Features which are otherwise discarded after a feature_style_processor invokes apply_to_layer() to request Features from a spatial DB etc.

Changed 20 months ago by artem

  • status changed from new to closed
  • resolution set to fixed

Applied in r790, thanks! It would be great to extend this functionality to support all geometry types and provide different storage types.

Changed 20 months ago by springmeyer

  • milestone changed from 0.5.2 to 0.6.0

will appear in the 0.6.0 release, so back-assigning to 0.6.0 milestone.

Lwu can you open another ticket on supporting Line and Polygon geometries?

Note: See TracTickets for help on using tickets.