diff --git a/planet/reconstitute.py b/planet/reconstitute.py index 6dc8ccc..8d0979c 100644 --- a/planet/reconstitute.py +++ b/planet/reconstitute.py @@ -304,6 +304,21 @@ def reconstitute(feed, entry): if entry.has_key('geo_lat') and \ entry.has_key('geo_long'): location(xentry, (float)(entry.get('geo_long',None)), (float)(entry.get('geo_lat',None))) + if entry.has_key('georss_point'): + coordinates = re.split('[,\s]', entry.get('georss_point')) + location(xentry, (float)(coordinates[1]), (float)(coordinates[0])) + elif entry.has_key('georss_line'): + coordinates = re.split('[,\s]', entry.get('georss_line')) + location(xentry, (float)(coordinates[1]), (float)(coordinates[0])) + elif entry.has_key('georss_circle'): + coordinates = re.split('[,\s]', entry.get('georss_circle')) + location(xentry, (float)(coordinates[1]), (float)(coordinates[0])) + elif entry.has_key('georss_box'): + coordinates = re.split('[,\s]', entry.get('georss_box')) + location(xentry, ((float)(coordinates[1])+(float)(coordinates[3]))/2, ((float)(coordinates[0])+(float)(coordinates[2]))/2) + elif entry.has_key('georss_polygon'): + coordinates = re.split('[,\s]', entry.get('georss_polygon')) + location(xentry, (float)(coordinates[1]), (float)(coordinates[0])) # author / contributor author_detail = entry.get('author_detail',{}) diff --git a/tests/data/reconstitute/georss_box_latlong.xml b/tests/data/reconstitute/georss_box_latlong.xml new file mode 100644 index 0000000..4973fe8 --- /dev/null +++ b/tests/data/reconstitute/georss_box_latlong.xml @@ -0,0 +1,10 @@ + + + + + 42.943 -71.032 43.039 -69.856 + + diff --git a/tests/data/reconstitute/georss_placeboxpolygon_latlong.xml b/tests/data/reconstitute/georss_placeboxpolygon_latlong.xml new file mode 100644 index 0000000..396da5e --- /dev/null +++ b/tests/data/reconstitute/georss_placeboxpolygon_latlong.xml @@ -0,0 +1,15 @@ + + + + + + + 34.05260997 -118.43221212 34.05260997 -118.37216196 34.11240804 -118.37216196 34.11240804 -118.43221212 + + + + diff --git a/tests/data/reconstitute/georss_point_latlong.xml b/tests/data/reconstitute/georss_point_latlong.xml new file mode 100644 index 0000000..f21deea --- /dev/null +++ b/tests/data/reconstitute/georss_point_latlong.xml @@ -0,0 +1,11 @@ + + + + + 34.10164620,-118.32645359 + + diff --git a/tests/data/reconstitute/georss_polygon_latlong.xml b/tests/data/reconstitute/georss_polygon_latlong.xml new file mode 100644 index 0000000..e005b93 --- /dev/null +++ b/tests/data/reconstitute/georss_polygon_latlong.xml @@ -0,0 +1,10 @@ + + + + + 34.052610 -118.432212 34.05260997 -118.37216196 34.11240804 -118.37216196 34.11240804 -118.43221212 + +