Store values based on geographic data calculation (which polygon is a point within?)

This page summarizes the projects mentioned and recommended in the original post on /r/drupal

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. php-polylabel

    PHP port of https://github.com/mapbox/polylabel

    So this is something doable, but I'd say it required some advanced drupal chops and a few prior geo/mapping skills to know what each module does and how they work with each other. I have done this kinda thing since Drupal 6 and it still took me a few weeks of work to go from a few CSVs to a beautiful map with facets, per type styled polygons/points with nice labels, clustering, infowindows...

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. js-markerwithlabel

    Google Maps Marker with Label

    So this is something doable, but I'd say it required some advanced drupal chops and a few prior geo/mapping skills to know what each module does and how they work with each other. I have done this kinda thing since Drupal 6 and it still took me a few weeks of work to go from a few CSVs to a beautiful map with facets, per type styled polygons/points with nice labels, clustering, infowindows...

  4. GeoTools

    Geo-related tools PHP 7.3+ library built atop Geocoder and React libraries (by thephpleague)

    // Loop on all loaded zones_entities /* @var $zone_geofield \Drupal\geofield\Plugin\Field\FieldType\GeoFieldItem */ $zone_geofield = $your_zone_entity->get('field_your_geofield')->getValue(); /* @var \Drupal\geofield\GeoPHP\GeoPHPInterface $geo_php_wrapper */ $geo_php_wrapper = \Drupal::service('geofield.geophp'); // or inserted via DI /* @var \Geometry$polygon*/ $polygon = $geo_php_wrapper->load($zone_geofield->value); /* @var $entity_geofield \Drupal\geofield\Plugin\Field\FieldType\GeoFieldItem */ $entity_geofield = $your_current_entity->get('field_your_geofield')->getValue(); $point = $geo_php_wrapper->load($entity_geofield->value); if( geoPHP::geosInstalled() ) { $in_zone = $polygon->contains($point); } else { // https://github.com/thephpleague/geotools#polygon $geotools_polygon = new \League\Geotools\Polygon\Polygon( $polygon->asArray() ); $geotools_point = \League\Geotools\Coordinate\Coordinate( $point->asArray() ); $in_zone = $geotools_polygon->pointInPolygon( $geotools_point ); } if( $in_zone ) { // Do things like filling a reference field $entity->set('field_ref_' . $your_zone_entity->bundle()', $your_zone_entity->id() ); }

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • What OpenVPN Configuration/server does not get picked up as a VPN?

    1 project | /r/PureVPNcom | 27 Oct 2022
  • ZERO EARNING ON VPS

    1 project | /r/MysteriumNetwork | 19 Oct 2022
  • Geolocation website blocked

    1 project | /r/privacy | 27 Sep 2022
  • A new release of PHP SDK enables user to easily get the real visitor IP behind proxy, such as #CloudFlare, #Sucuri and so on. https://github.com/chrislim2888/IP2Location-PHP-Module

    1 project | /r/ip2location | 21 Sep 2022
  • IP to Geolocation with Python

    2 projects | dev.to | 4 Sep 2022

Did you know that PHP is
the 14th most popular programming language
based on number of references?