[Cartoweb-users] Get ID (shapefile) for search in other DB

Oliver Christen oliver.christen at camptocamp.com
Thu Feb 18 02:27:20 EST 2010


it depends a bit of what you want to do exactly.
Cartoweb use a query by shape to get features ids from shapefiles. Practicaly, the query tools (QueryByPoint,QueryByBbox,QueryByPolygon,QueryByCircle) generate a feature (point, rectangle, polygon, circle) which is given to the query plugin, that feature is then used by the query plugin to do a queryByShape in the mapfile through the mapQuery plugin.

if you want to select an area on the map to get the ids of the underlying features and do some other actions with those ids, you can override the query plugin to do some extra actions once the mapQuery plugin has returned the query result to the Query plugin.

You can do that by extending the Query plugin (see 2.3.3. Extending a Plugin in the documentation, http://www.cartoweb.org/doc_head/docbook/xhtml/dev.newplugin.html#dev.newplugin.adapting.extending) and overriding the function processResult and initializeResult.
These 2 functions receive the query result and call the Table plugin to format the result so it can be displayed in the user interface, but you can certainly add some condition (for example by passing an extra parameter) to handle differently the query result.

once you have the query result, you can simply parse it and do what you want with them, like querying a database.

there should be some examples of plugin override in the mailing-list archive, also have a look at the http://www.cartoweb.org/cwiki/HowTo if you are not used to the plugins structure and logic, there are a few simple examples.

  ----- Original Message ----- 
  From: Luzanilton Filho 
  To: cartoweb-users at lists.maptools.org 
  Sent: Thursday, February 18, 2010 12:57 AM
  Subject: [Cartoweb-users] Get ID (shapefile) for search in other DB

  Please, Mrs

  How to i, get the ID in shapefile and search this ID in other database (mysql) for example.


  Luzanilton Filho
  Analista de Sistemas
  Sistemas de Informação
  luzanilton at gmail.com
  luzanilton at hotmail.com


  Cartoweb-users mailing list
  Cartoweb-users at lists.maptools.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20100218/fae07b75/attachment.htm 

More information about the Cartoweb-users mailing list