How to automate selecting specific xyz map data from an existing xyz data set?

조회 수: 5 (최근 30일)
I have a bathymetry map that provides a 1 meter resolution. However, I don't want all of the map data. I want a 1024X1024 meter section of the map so that I can run comparrisons. The xyz map data I have is lat/long/alt and I'd like to automate the process and be able to populate a 1024X1024 matrix with z data.
I have attached a link to the xyz file since it is too large and a .jpg file so that you can see what the map looks like. I've also drawn a blue box around the desired location.
website.jpg
This is a painful process to go cell by cell so I appriciate all help.
InkedShalebeds_1m10clr_LI.jpg
  댓글 수: 7
BlkHoleSun
BlkHoleSun 2019년 1월 15일
I've made some good progress so far. I've been able to get the lat/lon values and create a box around what I want. I was attempting to extract the data by finding the values that are > or < the lines I made around the box. That doesn't seem to be working since the find function doesn't like non-constant threshold values. Any thoughts or advice on extracting the desired data?
Walter Roberson
Walter Roberson 2019년 1월 15일
A question would be how accurate the boundaries have to be. The map spacing is in physical meters, but imposing lat/long boundaries implies boundaries that are rectilear in physical meters. Your source about 7.3 km by about 6.9 km, which I figure is large enough that the curvature of the Earth would several few meters off of the upper left and upper right if the lat/long boundaries need to be strict.
I would tend to suggest that you just translate the lat/long boundaries at the southern edge and use those to select a rectangular portion of the data instead of worry about the curvature.

댓글을 달려면 로그인하십시오.

채택된 답변

BlkHoleSun
BlkHoleSun 2019년 1월 18일
Walter and KSSV,
Sorry it's been a while. I figured it all out. I first determined the slope of the box I wanted and the top left point (could have pick any point). I then used algebra to compute the other corners of the box. I then did a linspace to make 2 sets of parallel lines with 256 points. I then created a for loop to connect the two lines using linspace again for 256 points inbetween the two lines. This resulted in a 256X256. Next, I had to get z data over. I used the reshape function to get my 256X256 into a single column, then used the griddata function for the z values and used reshape to get it back into a 256X256. Now I'm on to calculating Boltsman and Shannon entropy measure for comparrison! Thanks for all your help!

추가 답변 (1개)

KSSV
KSSV 2019년 1월 15일
Read about inpolygon. If you have the vertices of closed region/ polygon; ou can get the points lying inside the region.
  댓글 수: 5
BlkHoleSun
BlkHoleSun 2019년 1월 15일
Walter,
I used a series of lines using some old algebra and approximated the four poins of the square. It was a huge pain.
KSSV,
I'll look into griddata in the morning and let you both know how the results fair.
thanks again for all your help so far...this is a pretty big project!

댓글을 달려면 로그인하십시오.

태그

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by