필터 지우기
필터 지우기

Shapewrite Error: Unknown Shape Identification

조회 수: 8 (최근 30일)
Russell Nasrallah
Russell Nasrallah 2020년 1월 23일
답변: Shubh Sahu 2020년 1월 28일
Hello All,
I am attempting to export a shapefile from my matlab code that will include 4 field
Shapefile = [X,Y,ID,Magnitude].
I have tried using both the mappoints and geopoints methods in order to create a strucutred array, and then using the shapewrite function to output the shapefile, however, every time I attempt to run the shapewrite function I get a "Unknown shape identification: shapefile_name.shp'
In addition, I have tried using the examples on the shapewrite documentation and get the same error using those examples. Googling has not yielded any results as to what the error could indicate either.
I've attached a text file with the ID, Coordinates X, Coordinate Y, and Magnitude below if anyone else wants to attempt converting this to a point shapefile with ID and Magnitude attributes.
  댓글 수: 1
Guillaume
Guillaume 2020년 1월 23일
Please give the full text of the error message. Everything in red.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shubh Sahu
Shubh Sahu 2020년 1월 28일
Hey!
Please try reading your data in this way and then use Shapewrite.
clear all; clc;
s = tdfread('New Text Document.txt', '\t');
tableData = s.x_10x2E7100000e0x2B02_90x2E2359296e0x2B05_20x2E2919476e0x2B05_0;
ShapeFile.X = tableData(:, 1);
ShapeFile.Y = tableData(:, 2);
ShapeFile.ID = tableData(:, 3);
ShapeFile.Mag = tableData(:, 4);
shapewrite(mappoint(ShapeFile), 'shapefile_name.shp');
shaperead('shapefile_name.shp')
Hope this will help you.

카테고리

Help CenterFile Exchange에서 Google Earth에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by