Skip to topic | Skip to bottom
Home
Main
Main.XeniaPackageV2Drifterr1.2 - 19 Dec 2006 - 20:43 - JeremyCothrantopic end

Start of topic | Skip to actions
Notes on running particle drifter inputs into a Xenia version 2 database instance and their corresponding display.

Worked through most of how to take Charlton's old particle drifter process and run it against a xenia (version 2) instance. The following notes should describe everything needed to get the drifter flows from horizon marine ( http://www.horizonmarine.com/ioos/seacoos.txt ) or aoml ( http://cromwell.marine.unc.edu/drifters/aoml_drifters.txt ) populating into a local xenia_v2 instance.

Create the database instance

Download the xenia_v2 sql

#as user postgres

createdb db_xenia_v2
psql -U postgres -d db_xenia_v2 -f db_xenia_v2_simple_schema.sql

Add postgis capabilities

###add postgis capabilities to db #use your filepath to associated postgis files below

createlang plpgsql db_xenia_v2
psql -d db_xenia_v2 -f /usr/local/pgsql/share/contrib/postgis.sql #or lwpostgis.sql
psql -d db_xenia_v2 -f /usr/local/pgsql/share/contrib/spatial_ref_sys.sql

Initial database table population and function/trigger setup

#download and run this sql to populate the data dictionary tables

#download and run this sql to add the necessary postgis columns to the multi_obs table, corresponding line segment function and initial organization/platform/sensor lookups

Data feeds and conversion to SQL

The following perl scripts use the perl DBI package. You'll need to modify the server/filepath/database particulars to your configuration.

The output sql file is currently hardcoded to be 'test.sorted.sql' but can be changed as needed. Note that the initial output is simply 'test' but this is passed to the unix 'sort' routine which gives a chronologically sorted increasing file listing which is critical to the proper database population order to produce the appropriate connected line segments.

The following input fields are ignored

  • distance
  • deltime

One of the main differences from the original scripts is that running against the Xenia instance, a drifter is treated as a moving platform and the platform_handle is like 'horizon_marine:01712:drifter' where the drifter id is treated as the platform.short_name and used to uniquely identify the platform. If a new drifter id is included in the input stream, the script will recognize this and automatically add the corresponding new platform_id and sensor_id(s).

Horizon Marine

The following perl script will take this sample file or the same formatted live stream listed above and create a sql file for populating the database.

To create the sql file

perl process_file_xenia_hm sample_hm.txt

AOML

The following perl script will take this sample file or the same formatted live stream listed above and create a sql file for populating the database.

To create the sql file

perl process_file_xenia_hm sample_hm.txt

The differences between the AOML conversion and HM are

  • the organization references
  • the choice of string to indicate a commented/ignored line
  • no polar to compass-rose conversion needed
  • -NaN degree indicating no movement are ignored for position tracking purposes

Display

The following minimal test mapserver mapfile was used with shp2img to verify the particle trajectory producing the below image.

/usr2/installation_files/mapserver-4.1/shp2img -m drifter.map -o drifter.png

In the test mapfile note to change the EXTENT argument so that the particle trajectories are visible within the extents. You'll need to change the server/filepaths as needed. I also have included the second and third map layers which reference only 'the_geom' but am not sure if or how they are utilized in the existing seacoos setup.

The first map layer display works by using an OUTLINE statement on the 'the_geom_line' column to graph the line segments according to their respective drifter speed for that segment.

drifter.png

-- JeremyCothran - 16 Dec 2006
to top

I Attachment Action Size Date Who Comment
drifter.sql manage 2.5 K 16 Dec 2006 - 19:20 JeremyCothran NA
drifter.png manage 6.0 K 16 Dec 2006 - 19:51 JeremyCothran NA
process_file_xenia_hm.pl.txt manage 3.3 K 16 Dec 2006 - 20:05 JeremyCothran NA
sample_data_hm.txt manage 123.0 K 16 Dec 2006 - 19:56 JeremyCothran NA
process_file_xenia_aoml.pl.txt manage 3.3 K 16 Dec 2006 - 20:06 JeremyCothran NA
sample_data_aoml.txt manage 305.7 K 16 Dec 2006 - 19:57 JeremyCothran NA
drifter_map.txt manage 8.1 K 19 Dec 2006 - 20:39 JeremyCothran na

You are here: Main > XeniaPackageV2Drifter

to top

Copyright © 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding DMCC? Send feedback