Loading

NEW FIELD LOOKUP

  1. /* See if we are in a known field */
  2. SET NEW.field_id = 2215;
  3. SET lon =  NEW.longitude;
  4. SET lat = NEW.latitude;
  5. SET mystring = CONCAT('POINT(', lon , ' ', lat, ')');
  6. SET g = GeomFromText(mystring);
  7.  
  8. SELECT field_id, field_name INTO field_id_, field_name_ FROM gts_hectare_birdseye_fields.fields
  9. WHERE ST_CONTAINS(FIELDS.geo_polygon, g) ORDER BY FIELDS.field_id DESC LIMIT 1;

Comments