How to compare node location with a geographic region?

Events happening in the community are now at Drupal community events on www.drupal.org.
marcoscano's picture

Hello everybody

I'm quite new to rules and drupal (I'm starting with D7), and I'm having no luck so far with my specific problem, which is:

Before the node is saved, I need to check if the node (I'm using Location module + Gmaps for the geographic information) is located within a delimited region on the map (it's not a cyrcle, I need to define a polygon). All nodes that are not inside this polygon should not be created (or deleted after creation). Actually this polygon is a geographic real area, so I imagine it could be feasible also checking the city name against some good database of city names, but I'd rather not to use this solution because in my region there are 2 official languages (names are different depending on the language), and I'd like also to be robust against mispelling the names of the cities).

If anybody has experience with a similar need, it would be nice to know at least which modules to investigate in order to go in the right direction.

Thanks a lot

Regards

Comments

.

ayesh's picture

I think it would be easier if you create a module or use existing to do that. See http://tinyurl.com/3u8ozjb
Anyway, if the polygon is a fixed one, you could check long/latitudes using a a numeric comparison. But it's not an "awesome" usage of Rules, I think.

Did you try openlayers module ?

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: