Platform
Resources
Pricing
Sign in
Get started
JAXA Earth API
"JAXA Earth API for JavaScript" examples on the Observable by the JAXA Earth Observation Research Center
Workspace
Fork
Public
2 collections
By
JAXA Earth API
Edited
Feb 3
2 forks
Insert cell
Insert cell
Insert cell
Insert cell
je
=
require
(
"https://data.earth.jaxa.jp/api/javascript/v1.2.3/jaxa.earth.umd.js"
)
;
Insert cell
Insert cell
Insert cell
Insert cell
img
=
await
je
.
getImage
(
{
collection
,
bbox
:
[
-
180
,
-
90
,
180
,
90
]
,
//west,south,east,north
width
:
1000
,
//px
height
:
500
,
//px
colorMap
:
{
min
:
0
,
max
:
6000
,
colors
:
"jet"
,
//blue-green-orange-red
}
,
}
)
;
Insert cell
Insert cell
img
.
getCanvas
(
)
;
Insert cell
img
.
getLegend
(
300
,
20
,
10
)
;
Insert cell
Insert cell
Insert cell
data
=
img
.
getData
(
)
;
Insert cell
//ignore NaN (no data area such as ocean) and 0m or less (such as sea) and store to array named "plotData" as an object
//NaN(非数値。外洋などでデータが無い部分など)や0m以下の部分(海など)を無視し、プロット用のオブジェクト配列としてplotDataに格納
plotData
=
{
//Float32Array
const
validData
=
data
.
data
.
filter
(
e
=>
!
isNaN
(
e
)
)
.
filter
(
e
=>
e
>
0
)
;
const
plotData
=
[
]
;
for
(
let
i
=
0
;
i
<
validData
.
length
;
i
++
)
{
plotData
.
push
(
{
"elevation"
:
validData
[
i
]
}
)
;
}
return
plotData
;
}
Insert cell
Insert cell
Plot
.
plot
(
{
x
:
{
grid
:
true
}
,
y
:
{
grid
:
true
}
,
color
:
{
legend
:
true
}
,
grid
:
true
,
marks
:
[
Plot
.
rectY
(
plotData
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
"elevation"
}
)
)
,
Plot
.
ruleY
(
[
0
]
)
]
}
)
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Listed in...
Terrain
JAXA Earth API
Simple Examples
JAXA Earth API
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
je
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
collection
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
img
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plotData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML