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

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
shapewrite Jonathan 3 Mar, 2011 14:24:15
shapefiles Jonathan 3 Mar, 2011 14:24:15
rssFeed for this Thread

Contact us