Shapewrite Error: Unknown Shape Identification

3 ビュー (過去 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 Center および File ExchangeGoogle Earth についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by