Esempio n. 1
0
func (p WOFPointInPolygon) IndexGeoJSONFeature(feature *geojson.WOFFeature) error {

	spatial, spatial_err := feature.EnSpatialize()

	if spatial_err != nil {

		body := feature.Body()
		geom_type, ok := body.Path("geometry.type").Data().(string)

		if ok && geom_type == "Point" {
			p.Logger.Warning("feature is a Point type so I am ignoring it...")
			return nil
		}

		p.Logger.Error("failed to enspatialize feature, because %s", spatial_err)
		return spatial_err
	}

	return p.IndexSpatialFeature(spatial)
}