Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
shapewrite and matlab

Subject: shapewrite and matlab

From: Jonathan

Date: 3 Mar, 2011 19:21:04

Message: 1 of 1

Hi,
I have a matrix (5541*2) containing longitude and latitude coordinates. I am trying to write an ESRI shapefile using the shapewrite function. My script is:

x = a(:,1); %longitude
y = a(:,2); %latitude
id=['test'];

%create a 1*1 empty structure that can be written using shapewrite
shp=repmat(struct('X',[],'Y',[],'Geometry','MultiPoint','ID',[]),1,1);

%add data to structure
[shp(1).X]=x; %x is your eastings column
[shp(1).Y]=y; %y is your northings column
[shp(1).ID]=id;

% name and create file path
dname='C:\temp\';
name=['test'];

%write the shapefile
shapewrite(shp,[dname,name])

The problem I'm having is that when you bring the newly created shapefile into ArcGIS, the attributes (i.e. lat, lon values) associated with each point are not displayed (you can only see these values in matlab). Does anyone know how to get the actual point values to be be also available in ArcGIS?

Thanks
Jon

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us