Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

gdal_nn.sh 887 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  1. #!/usr/bin/env bash
  2. #
  3. # Test NearestNeighbor for Cartesian data via GDAL
  4. ps=gdal_nn.ps
  5. cat << EOF > tridata.csv
  6. 2.53857 5.16657 0
  7. 2.48365 6.26811 1
  8. 8.68883 4.55983 2
  9. 4.11104 7.78623 3
  10. 1.79704 6.53027 4
  11. 7.17493 3.81713 5
  12. 3.41052 8.18161 6
  13. 8.35062 1.43348 7
  14. 8.1706 4.46765 8
  15. 5.27815 1.15172 9
  16. EOF
  17. cat << EOF > tridata.vrt
  18. <OGRVRTDataSource>
  19. <OGRVRTLayer name="tridata">
  20. <SrcDataSource>tridata.csv</SrcDataSource>
  21. <GeometryType>wkbPoint</GeometryType>
  22. <GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>
  23. </OGRVRTLayer>
  24. </OGRVRTDataSource>
  25. EOF
  26. gmt makecpt -Ccategorical -T0/10/1 > t.cpt
  27. gmt grdgdal tridata.csv -R0/10/0/10 -Gjunk.nc -I0.05 -F"-a nearest"
  28. gmt grdgdal tridata.vrt -R0/10/0/10 -Gjunk.nc -I0.05 -F"-a nearest" -M+r
  29. gmt grdimage junk.nc -JX6i -P -Baf -BWSnE+t"Natural Nearest Neighbor Gridding" -Ct.cpt -Xc > $ps
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...