GeographicPositionProperty.fromCrawledProperty constructor

GeographicPositionProperty.fromCrawledProperty(
  1. CrawledProperty property
)

Implementation

factory GeographicPositionProperty.fromCrawledProperty(
    CrawledProperty property) {
  assert(
    property.name.toUpperCase() == "GEO",
    "Received invalid property: ${property.name}",
  );

  return GeographicPositionProperty(
    lat: FloatValue.fromCrawledStringValue(property.value.split(";").first)
        .value,
    long: FloatValue.fromCrawledStringValue(property.value.split(";").last)
        .value,
  );
}