range different longitude and latitude geoshow
Mostra commenti meno recenti
I have longitude 112 to 114 and latitude -6.8 to -7.4.I am trying to range the longitude and latitude from geoshow, but somehow it doesnt change much
close all ;
clear;
data1 = shaperead ( 'data.shp' ); % polygon data
geoshow (data1)
u = shaperead ( 'points.shp' , 'UseGeoCoords' , true) % point data of 3050x1
h = geoshow (u, 'Marker' , 'o' , ...
'MarkerEdgeColor' , 'g' , ...
'MarkerSize' , 6)
legend ([h], 0.5, 'ok' );
so data1 is the shapefile of polygon and u are the point location.I wanted to make the longitude and latitude is range by 0.5 or 1 in geoshow? Inside file u it contains Geometry = 'point', Lon (Longitude) and Lat (Latitude ).
I try to edit in legend but it shows:
Error using legend> process_inputs (line 554)
Invalid argument.Type 'help legend' for more information.
1 Commento
darova
il 6 Apr 2020
Please attacht the data. Can you make a simple drawing of what you are trying todo? The qustion is unclear
Risposte (3)
muhammad iqbal habibie
il 7 Apr 2020
Modificato: muhammad iqbal habibie
il 7 Apr 2020
0 voti
darova
il 7 Apr 2020
0 voti
Here is my idea
Use meshgrid to create a grid (red points)
Use inpolygon to choose points inside map (blue circles)

2 Commenti
muhammad iqbal habibie
il 8 Apr 2020
darova
il 8 Apr 2020
try this
latstart = 112;
lonstart = -7.5;
step = 0.5;
newlat = round((lat-latstart)/step)*step + latstart;
newlon = round((lon-lontart)/step)*step + lonstart;
Some duplicate values may appear. You can remove them
[~,ix1] = unique(newlat);
[~,ix2] = unique(newlon);
ix = unique([ix1(:);ix2(:)]);
newlat = newlat(ix);
newlon = newlon(ix);
Sean de Wolski
il 7 Apr 2020
0 voti
Look at bufferm https://www.mathworks.com/help/map/ref/bufferm.html. Call that on your data and then just take the bounds() of it.
Categorie
Scopri di più su Environment and Clutter in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!