MATLAB Answers

0

Read a shapefile with name that was provided from sprintf

Asked by Kelly Kyriakou on 7 Sep 2015
Latest activity Commented on by Kelly Kyriakou on 7 Sep 2015
Hello everybody,
I want to read one shapefile, with shaperead command, that his name will change. I have written this code:
phase2open = cellstr(get(hObject,'String'))
nameofphase2open = phase2open{get(hObject,'Value')}
shp2open= sprintf('phase%s_RP%d_%s.shp',nameofphase2open,RPname2open,nameofsource2open)
getshp=shaperead('%s',shp2open,'UseGeoCoords',true)
It understands the name and print it but shaperead failed giving this error: "Error using shaperead>parseInputs (line 546) Expected input number 2, PARAM1, to match one of these strings: 'RecordNumbers', 'BoundingBox', 'Selector', 'Attributes', 'UseGeoCoords"____

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 7 Sep 2015
 Accepted Answer

getshp = shaperead(shp2open,'UseGeoCoords',true)

  1 Comment

Sign in to comment.