вектор в растр из данных в шейп-файле - PullRequest
0 голосов
/ 21 января 2020

Я пытаюсь преобразовать векторные данные, соответствующие странам в шейп-файле, в растр с разрешением 0,1 градуса. Для этого я использую функции

vec2mtx and imbedm

. Вот что я пытался, но MatLab выдает ошибку.

%%%%here states is a shapefile of the world.
states=shaperead('Z:\shpfiles\TM_WORLD_BORDERS_SIMPL-0.3.shp');
lat = [states.Y]; %%lat and lon are of size  30032x1 each and  there are 246 countries in the shapefile
lon = [states.X];
%%%% I convert it to a matrix of 0.1 degree resolution
[Z, R] = vec2mtx(lat, lon, ...
       10, [-90 90], [-180 180], 'filled');
%%%% The same shapefile has an attribute of literacy rate for each country, to convert the literacy rate at 0.1 degree resolution, keeping the 
%%%% value constant within each country,
Z =  imbedm(lat, lon, [states.Lit2005], Z, R)

%%%%%THE ERROR
Error using imbedm (line 53)
Function imbedm expected its LAT, LON, and VALUE inputs to have the same size.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...