Thread Subject: Plotting latitude and longitude

Subject: Plotting latitude and longitude

From: starski

Date: 5 Feb, 2012 06:03:09

Message: 1 of 3

Hi

I am trying to plot some latitude and longitude coordinates in Matlab and I am getting errors. I am reading in a shapefile (which was already projected in ArcMap) and trying to plot it using the following commands.

coords=shaperead('MDR_locality8.shp','UseGeoCoords',true)
geoshow(lat,long)

The first line seems to work fine. lat and long are what latitude and longitude are called in the coords file. I get the following error after the geoshow command:
??? Undefined function or variable 'lat'.

I don't understand what the problem is with lat. This is definitely what it is called in the coords file! Can anyone help me?

Thanks in advance
Helen

Subject: Plotting latitude and longitude

From: Andrew Stevens

Date: 5 Feb, 2012 22:31:10

Message: 2 of 3

"starski" wrote in message <jgl62t$p2s$1@newscl01ah.mathworks.com>...
> Hi
>
> I am trying to plot some latitude and longitude coordinates in Matlab and I am getting errors. I am reading in a shapefile (which was already projected in ArcMap) and trying to plot it using the following commands.
>
> coords=shaperead('MDR_locality8.shp','UseGeoCoords',true)
> geoshow(lat,long)
>
> The first line seems to work fine. lat and long are what latitude and longitude are called in the coords file. I get the following error after the geoshow command:
> ??? Undefined function or variable 'lat'.
>
> I don't understand what the problem is with lat. This is definitely what it is called in the coords file! Can anyone help me?
>
> Thanks in advance
> Helen

Helen,

Output from the shaperead command is a structure array. If you type, coords, what do you see? If lat and long are indeed 'fields' of the structure, then you could probably use (though I am unfamiliar with the function GEOSHOW),

geoshow(coords.lat,coords.long)

-Andrew

Subject: Plotting latitude and longitude

From: ImageAnalyst

Date: 5 Feb, 2012 17:17:09

Message: 3 of 3

On Feb 5, 1:03 am, "starski " <jenkins.he...@gmail.com> wrote:
> Hi
>
> I am trying to plot some latitude and longitude coordinates in Matlab and I am getting errors. I am reading in a shapefile (which was already projected in ArcMap) and trying to plot it using the following commands.
>
> coords=shaperead('MDR_locality8.shp','UseGeoCoords',true)
> geoshow(lat,long)
>
> The first line seems to work fine. lat and long are what latitude and longitude are called in the coords file. I get the following error after the geoshow command:
> ??? Undefined function or variable 'lat'.
>
> I don't understand what the problem is with lat. This is definitely what it is called in the coords file! Can anyone help me?
>
> Thanks in advance
> Helen

------------------------------------------------------
Did you look at what coords is? Maybe it's a structure and you need
to do something like
lat = coords.lat;
long = coords.long;

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
mapping Rob Comer 5 Feb, 2012 19:41:33
plotting latitu... starski 5 Feb, 2012 01:04:17
rssFeed for this Thread

Contact us at files@mathworks.com