[R-sig-Geo] strange srtm3 query in geonames package

Ashton Shortridge ashton at msu.edu
Mon Nov 23 23:38:07 CET 2009


Hi Michael,

there are several SRTM 'holes' over the United States, evidently due to some 
data processing issues on a couple of orbits. Unfortunately for you one of the 
largest is over part of North Carolina. The following URL has some maps of the 
major gaps:
http://www.mission-planning.com/DTED_Part3.htm

There are other US elevation datasets, including NED from seamless.usgs.gov, 
that are better quality and freely available, and might suit your needs.

Ashton

On Sunday 22 November 2009 14:19:46 Michael Denslow wrote:
> Thanks Barry!
> 
> On Sun, Nov 22, 2009 at 2:02 PM, Barry Rowlingson
> 
> <b.rowlingson at lancaster.ac.uk> wrote:
> > On Sun, Nov 22, 2009 at 6:23 PM, Michael Denslow
> >
> > <michael.denslow at gmail.com> wrote:
> >> Dear r-sig-geo and Barry,
> >>
> >> I am getting a strange value when doing a query using the function
> >> GNsrtm3 in the geonames package.
> >> Here is the code.
> >>
> >> library(geonames)
> >> GNsrtm3(34.63874,-79.10111)  # outside Lumberton North Carolina USA!
> >>
> >>
> >>   srtm3       lng      lat
> >> 1 -32768 -79.10111 34.63874
> >>
> >> Warning message:
> >> In readLines(u) :
> >>  incomplete final line found on
> >> 'http://ws.geonames.org/srtm3JSON?lat=34.63874&lng=-79.10111'
> >>
> >>
> >> I think the elevation value should be around 47 meters. The geonames
> >> website says 'ocean areas have been masked as "no data" and have been
> >> assigned a value of -32768'.
> >> http://www.geonames.org/export/web-services.html#srtm3
> >> I tried adjusting the lat, long values to query some nearby cells but
> >> I still get -32768.
> >>
> >> Are these kinds of errors common in this dataset? Any suggestions?
> >> I am would actually prefer to get an average elevation for the county
> >> (Robeson) but am settling for the county centroid at this point.
> >
> >  I don't really know the details of the srtm3 data set, but I do see
> > that geonames has two other DEM datasets - ASTER and GTOPO30. There's
> > a function for GTOPO30 in geonames, but not ASTER. It's easy enough to
> >
> > write though:
> >> GNaster=function(lat,lng){return(as.data.frame(geonames:::getJson("aster
> >>gdemJSON",list(lat=lat,lng=lng))))}
> >
> >  and I may include it in a new release (as well as getting rid of
> > those end-of-line warnings). These two services agree with themselves
> > and with you pretty well for your test location:
> 
> It would be great to have GNaster added.
> 
> >> GNgtopo30(34.63874,-79.10111)
> >
> >  gtopo30       lng      lat
> > 1      46 -79.10111 34.63874
> >
> >> GNaster(34.63874,-79.10111)
> >
> >  astergdem       lng      lat
> > 1        47 -79.10111 34.63874
> >
> >  For an 'average' elevation you might be better off sampling many
> > locations over your polygon.
> 
> Sounds like a good idea.
> 
> Thanks again for your help!
> 
> Michael
> 
> > Barry
> 

-- 
Ashton Shortridge
Associate Professor			ashton at msu.edu
Dept of Geography			http://www.msu.edu/~ashton
235 Geography Building		ph (517) 432-3561
Michigan State University		fx (517) 432-1671



More information about the R-sig-Geo mailing list