[postgis-users] How to Store Metadata?
Stephen Woodbridge
woodbri at swoodbridge.com
Fri Jun 24 06:13:16 PDT 2011
On 6/24/2011 9:02 AM, Brett Antonides wrote:
> Hi Everybody,
>
> Could someone please tell me or send me a link describing how to best
> store ISO 19115/19139 metadata with my spatial data in PostGIS?
> Ultimately, the data will be stored in PostGIS, published via
> GeoServer, and cataloged in GeoNetwork. I know I can just load the
> metadata into GeoNetwork, but I'd rather store it in the database so it
> doesn't get lost if data is migrated to another server. I'm hoping
> someone has already cracked this nut. I tried searching for the answer,
> but Google failed me (or I failed Google). Either way I'd appreciate
> any help you can provide.
I've never done this, but here are some ideas that might work for you
depending on your use cases. It sounds like you just need to carry it
along as baggage with your data so you might just do something like:
data_table - your data
data_table_meta - your metadata
insert into data_table_meta set metadata = 'text_of_metadata';
or you might create a table that holds all metadata records:
all_metadata (
schemaname text,
tablename text,
metadata text
)
insert into all_metadata set schemaname='myschema', tablename='mytable',
metadata='text_of_metadata';
You could also set up a full text search index on the metadata column if
you wanted it to be searchable.
If you need you metadata stored by key=value pairs then you might
construct a table like
metadata (
key text,
value text
)
and construct keys as something like xpath strings to the values.
-Steve
More information about the postgis-users
mailing list