Comments (1)
Some notes:
Find UTM zone for conversion
This works for West longitudes only though (from SO)
long2UTM <- function(long) {
(floor((long + 180)/6) %% 60) + 1
}
long2UTM(-149.9)
[1] 6
For all longitudes
long2utm <- function(lon, lat) {
if(56 <= lat & lat < 64){
if(0 <= lon & lon < 3){ 31 } else
if(3 <= lon & lon < 12) { 32 } else { NULL }
} else
if(72 <= lat) {
if(0 <= lon & lon < 9){ 31 } else
if(9 <= lon & lon < 21) { 33 } else
if(21 <= lon & lon < 33) { 35 } else
if(33 <= lon & lon < 42) { 37 } else { NULL }
}
(floor((lon + 180)/6) %% 60) + 1
}
long2utm(-60, 65)
21
Convert occ output lat/long coordinates to UTM
library(spocc)
dat <- occ(query='Accipiter striatus', from='gbif')
dat <- na.omit(dat@gbif@data)
coordinates(dat)=~longitude+latitude
proj4string(dat) = CRS("+init=epsg:4326")
spTransform(dat, CRS("+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs +towgs84=0,0,0"))
Essentially would have to do this point by point
Since a data.frame we get back from a source we don't know what zones they are in ahead of time. Though I suppose we could do basic stuff, and just leave complicated stuff up to the user.
from spocc.
Related Issues (20)
- occ "gbif" search is not working HOT 2
- Add option to use GBIF downloads in addition to search HOT 2
- Add option to use auk for bulk ebird data
- drop ecoengine as an option: pkg archived on cran
- failing cran checks - due to vcr change most likely
- has_coords not functioning as expected HOT 1
- error with occ2df HOT 2
- occ2df with coordinate uncertainty and occurrence status HOT 4
- error with the limitation extractign data from OBIS HOT 4
- Add Cogent Server Status Messages
- always return latitude and longitude as numeric values HOT 1
- Resolving "non-zero exit status" HOT 1
- Citing GBIF data properly
- Search with occ does not match the inatopts HOT 2
- Remove rbison
- Change to new cran checks badge URL HOT 1
- submit new version to CRAN? HOT 8
- occ() reports more records returned than found
- how can I save my search results in csv, can anyone help me ?
- Pending update to ridigbio will break spocc! HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spocc.