Skip to content

Instantly share code, notes, and snippets.

@renzok
Created November 13, 2015 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renzok/cf0d67fc0df67d196b44 to your computer and use it in GitHub Desktop.
Save renzok/cf0d67fc0df67d196b44 to your computer and use it in GitHub Desktop.
begin;
UPDATE osdregistry.samples
SET nitrate='nan',
nitrite='nan',
ammonium='nan',
phosphate='nan',
silicate='nan'
WHERE submission_id = 215 and osd_id = 117
returning *
;
UPDATE osdregistry.samples
SET ammonium=61,
curation_remark='assume ammonium to also be the same as submision 168',
curator = 'rkottman'
WHERE submission_id = 169 and osd_id = 4
returning *
;
select gid,label, id,
st_distance(geog,
ST_GeogFromText('SRID=4326;POINT(' || -149.53985 || ' ' || -17.2894 || ')')
)as dist_m
from marine_regions_stage.iho
where st_dwithin(
ST_GeogFromText('SRID=4326;POINT(' ||
-149.53985 || ' ' ||
-17.2894 || ')'),
iho.geog, 100000
);
select gid,label, id,
st_distance(
ST_GeogFromText('SRID=4326;POINT(' ||
33 || ' ' ||
35 || ')'),
iho.geog
) as dist_m
from marine_regions_stage.iho
where st_dwithin(
ST_GeogFromText('SRID=4326;POINT(' ||
33 || ' ' ||
35 || ')'),
iho.geog, 100000
) ;
select gid,label, id,
st_distance(
ST_GeogFromText('SRID=4326;POINT(' ||
-81.09 || ' ' ||
31.98 || ')'),
iho.geog
) as dist_m
from marine_regions_stage.iho
where st_dwithin(
ST_GeogFromText('SRID=4326;POINT(' ||
-81.09 || ' ' ||
31.98 || ')'),
iho.geog, 100000
) ;
select gid,label, id,gazetteer,
st_distance(
ST_GeogFromText('SRID=4326;POINT(' ||
-2.899 || ' ' ||
43.27 || ')'),
iho.geog
) as dist_m
from marine_regions_stage.iho
where st_dwithin(
ST_GeogFromText('SRID=4326;POINT(' ||
-2.899 || ' ' ||
43.27 || ')'),
iho.geog, 100000
) ;
rollback;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment