[Community] Looking for advice on adding dynamic points
sgillies at frii.com
Tue Jul 4 20:18:04 EEST 2006
On Jun 30, 2006, at 9:05 AM, Chris Matheson wrote:
> Hello everyone
> I'm looking for advice on adding dynamic points to my primaGIS map
> ( http://www.centralfrontenac.com/map ). I am perhaps more
> interested in learning about different ways this could be done than
> finding one perfect solution.
> I have a road network (shapefile) I obtained from our emergency
> response dispatch (I work in a municipality). It contains
> addressing attribute data. We imported the road network imported
> into postgresql/postgis. Then I created a plpgsql geolocating
> function, which accepts a street address as input, and outputs a
> location (using linear referencing) where that address is expected
> to be, based on the road network's information.
> I've added an interface to this function into zope as a zsql
> method, and created an interactive form:
> try: 1084
> Elizabeth St
> The form just output's the human readable coordinates, although the
> method returns postgis geometry datatype as well.
Your map is looking good!
> I'm looking for advice on how to tie this function into the map. I
> have three goals. The first I am very interested in, and the
> second and third are just "bonus".
> 1. I would like to have the returned point plotted on the map.
> 2. I would like to have all the returned points plotted on the map
> and persist for a particular users session.
> 3. I would like to have all the returned points plotted on the map
> and persist for a particular users session. I would like the user
> to be able to export the point data to gml or kml.
> The reason I'm intersted in #3, I would like our community groups
> and anyone else to be able to input addresses of clients (etc.),
> and get a file they could load in their gis or in google earth.
> Anyway, thanks for your time.
> Chris M.
You're right that there are probably multiple ways to do this. I'm
going to suggest one that may not ultimately be the best, but should
be easy to implement and provide you (and the rest of us) a way to
start thinking about the problem.
If you look at the demo creation script that you should have run
while learning to use PrimaGIS, you'll see an API for creating maps,
data stores, layers, etc. For your session points, I suggest that you
create PrimaGISDataLayers in a temp location, and push your points
into them. To display the points create temporary PrimaGISMaps (again
following from skins/primagis/createPrimaGISDemo.py) for a session,
and add your temporary PrimaGISDataLayer to the map.
Once your points are in a PrimaGISDataLayer, you can export to GML
and KML. One caveat here is that PrimaGISDataLayer is going to be
changed in the next release of PrimaGIS. Hopefully Kai will reply and
provide more details, but you can expect that PrimaGISDataLayers will
become much more like any other data store. At any rate, the new
classes should meet your needs.
More information about the Community