Ticket #583 (closed task: fixed)

Opened 13 years ago

Last modified 13 years ago

[M] Extract spatio and temporal info from MOLES

Reported by: selatham Owned by: selatham
Priority: critical Milestone: ReFactored_Discovery_WebServices
Component: discovery Version:
Keywords: MDIP WS-Discovery2 Cc:

Description

For use in an ingest script which populates the postgres/GIS db for spatio-temporal searching. Need to return id of record for use as the key.

Change History

comment:1 Changed 13 years ago by ko23

  • Status changed from new to closed
  • Resolution set to fixed

Stub B etc already do this and is available, so isn't it done?

comment:2 Changed 13 years ago by selatham

  • Status changed from closed to reopened
  • Resolution fixed deleted

I just want the spatio and temporal bits, preferably passed back in a handy list such as [id, start-date, end-date,N,E,S,W ] ready to stuff into postgres fields. Don't want to have to parse a whole XML document.

comment:3 Changed 13 years ago by domlowe

If you can get the records out of exist you could use the moles parser to do this in 5* lines of python.

*approx

comment:4 Changed 13 years ago by domlowe

This is how you would do it for one file:

import cElementTree
import molesReadWrite as MRW

dgMeta=MRW.dgMetadata()
dgMeta.fromXML(cElementTree.ElementTree(file='ECMWF-E40_B_BV102_F.xml').getroot())
bbox=dgMeta.dgMetadataRecord.dgDataEntity.dgDataSummary.dgDataCoverage.dgSpatialCoverage.BoundingBox
dates=dgMeta.dgMetadataRecord.dgDataEntity.dgDataSummary.dgDataCoverage.dgTemporalCoverage.DateRange
coverage= [dates.DateRangeEnd, dates.DateRangeStart, bbox.LimitNorth, bbox.LimitSouth,bbox.LimitEast, bbox.LimitWest]

print coverage

comment:5 Changed 13 years ago by selatham

  • Status changed from reopened to new
  • Owner changed from ko23 to selatham

OK. I'll look at doing this.

comment:6 Changed 13 years ago by selatham

  • Status changed from new to closed
  • Resolution set to fixed
  • Summary changed from [M] XQuery to return spatio and temporal info from MOLES to [M] Extract spatio and temporal info from MOLES

Done using the MolesReadWrite? python code and pgdb python postgres API. Needs plgging into ingest automation ticket #35.

Note: See TracTickets for help on using tickets.