Manel,

Nice catch. Could you file a ticket on this at trac.mapnik.org? Seems we do need a tolerance for the features_at_point() query as well when querying point geometries. It would be good to audit the other datasource plugins at the same time as this support is added to the PostGIS plugin.

Thanks,

Dane

On Jan 27, 2010, at 4:04 AM, <[email protected]> <[email protected] > wrote:

Hi,

I've two layers in PostGIS: multipolygon and point. When using GetFeatureInfo I successfully get results for the polygon layer, but it is _very_ difficult to get results for the point layer. One needs to click _exactly_ on top of the point and still you won't be able to get results most of the time. Using mapnik 0.7.0.

I've tracked this down to map.cpp, Map::query_map_point(), where the number of features returned is 0 for the point layer:

featureset_ptr fs = ds- >features_at_point(mapnik::coord2d(x,y));
                    int count = 0;
                    while (fs->next()) {
                        count++;
                    }
std::clog << "--> num features = " << count << "\n"; ... and is 1 for the polygon layer. So, this happens _before_ the "hit_test_filter".

Looking at plugins/input/postgis/postgis.cpp, features_at_point(), I can see the envelope has no "margin" or "radius" or "tolerance".

         Envelope<double> box(pt.x,pt.y,pt.x,pt.y);
std::string table_with_bbox = populate_tokens(table_,FMAX,box); Is there a tolerance that can be specified in postgis? how can I solve this?

Thanks in advance!


Manel Clos
UMAT - 972419417
Ajuntament de Girona

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to