Repository: ResonantGeoData/ResonantGeoData

Issue:
Annotated Geo Asset Model
Add a new model for arbitrary assets that have an annotated spatial context.

e.g. a 3rd party has a PowerPoint presentation and a data scrubbing routine to extract spatial metadata from that PPT. They would then populate this new annotated geo asset model with the extracted spatial metadata and point to it from another custom table holding their PPT or other random data formats. Then these entries would be searchable in a geospatial context.

think of all the different types of data that are not traditionally geospatial but could have geospatial context extracted or assigned: documents, presentations, etc.


Discussion:

Resolving patch:
diff --git a/rgd/geodata/migrations/0013_auto_20210512_1954.py b/rgd/geodata/migrations/0013_auto_20210512_1954.py
new file mode 100644
--- /dev/null
+++ b/rgd/geodata/migrations/0013_auto_20210512_1954.py
@@ -0,0 +1,40 @@
+# Generated by Django 3.2.2 on 2021-05-12 19:54
+
+import django.contrib.gis.db.models.fields
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('geodata', '0012_whitelistedemail'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='spatialentry',
+            name='footprint',
+            field=django.contrib.gis.db.models.fields.GeometryField(srid=4326),
+        ),
+        migrations.CreateModel(
+            name='SpatialAsset',
+            fields=[
+                (
+                    'spatialentry_ptr',
+                    models.OneToOneField(
+                        auto_created=True,
+                        on_delete=django.db.models.deletion.CASCADE,
+                        parent_link=True,
+                        primary_key=True,
+                        serialize=False,
+                        to='geodata.spatialentry',
+                    ),
+                ),
+                ('name', models.CharField(blank=True, max_length=1000)),
+                ('description', models.TextField(blank=True, null=True)),
+                ('files', models.ManyToManyField(to='geodata.ChecksumFile')),
+            ],
+            bases=('geodata.spatialentry',),
+        ),
+    ]
diff --git a/rgd/geodata/models/common.py b/rgd/geodata/models/common.py
--- a/rgd/geodata/models/common.py
+++ b/rgd/geodata/models/common.py
@@ -66,7 +66,7 @@ class SpatialEntry(models.Model):
     acquisition_date = models.DateTimeField(null=True, default=None, blank=True)
 
     # This can be used with GeoDjango's geographic database functions for spatial indexing
-    footprint = models.PolygonField(srid=DB_SRID)
+    footprint = models.GeometryField(srid=DB_SRID)
     outline = models.PolygonField(srid=DB_SRID)
 
     instrumentation = models.CharField(
@@ -329,3 +329,19 @@ def yield_vsi_path(self, internal=False):
 
 class WhitelistedEmail(models.Model):
     email = models.EmailField()
+
+
+class SpatialAsset(SpatialEntry):
+    """Any spatially referenced asset set.
+
+    This can be any collection of files that have a spatial reference and are
+    not explictly handled by the other SpatialEntry subtypes. For example, this
+    model can be used to hold a collection of PDF documents or slide decks that
+    have a georeference.
+
+    """
+
+    name = models.CharField(max_length=1000, blank=True)
+    description = models.TextField(null=True, blank=True)
+
+    files = models.ManyToManyField(ChecksumFile)


Test patch: