export lines in shapefile format

Hi guy I've a problem to export a line from Matlab to GIS. This is a part of code:
[dem Ref]=geotiffread('Demmask1.tif');
aP1 = pix2map(Ref,Peaks1ok(1,1),Peaks1ok(1,2));
aP2 = pix2map(Ref,Peaks2ok(1,1), Peaks2ok(1,2));
ax1 = [aP1(1,1) aP2(1,1)];
ay1 = [aP1(1,2) aP2(1,2)];
Lines = struct('ID',1,'Geometry','Line','X',ax1,'Y',ay1);
shapewrite(Lines, 'MergedFile.shp')
And the display result
But when i load it in GIS the line is shifted.
What's the problem? I think is something in pix2map projections, who can help me?

Answers (0)

Products

Asked:

on 27 Sep 2017

Edited:

on 27 Sep 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!