DistanceDevelopment / distance-bugs

A place to keep bugs in Distance
http://distancesampling.org/Distance
1 stars 0 forks source link

Distance 7 error message and possible bug issue #192

Closed kma8 closed 4 years ago

kma8 commented 4 years ago

IMG_0609 IMG_0610 Hi, I am a new user of distance. The shapefile I am trying to use has previously worked but now when I attempt to create a coverage layer I get the error message in the attached screen shots. Would much appreciate any help, thank you :)

erex commented 4 years ago

This is a fairly common error, rather than a bug. Shapefiles need a small amount of editing before they can be brought into Distance for use. The nature of the problem is this:

The cause of the error is that Distance requires a field in the shape file attributes called LinkID, populated with numerical values. In your case, with only a study area layer, that number would be 1.

There is a section in Chapter 5 of the Users Guide, entitled "Importing GIS Data by Copying an Existing Shapefile into the Data Folder" where this field is described:

Open the newly renamed shapefile in your GIS package, and add a field to the table. The field should be able to contain long integer numbers – in ArcView this means the field type should be “Number”, the width 16 and decimal places 0. Name this field “LinkID”.

• The LinkID field will be used to link records in the shapefile to records in Distance’s internal data table for this layer. Each

LinkID value must correspond with a value in the ID field of Distance’s internal table.

• If you only just created the Data Layer in Distance, then it doesn’t matter what order you number the records in the LinkID field of the shapefile. Start with 1, and go up to the number of records you have.

For further information

lenthomas commented 4 years ago

Just to add to what Eric said, the latest version of Distance for Windows has an Import Shape Wizard, which automates the process of creating the LinkID field and bringing the data into Distance. It's documented in Chapter 5, along with the other methods of importing geographic data, and is probably now the easiest way to get the job done. If you're having trouble with an already-existing layer, perhaps you could try re-importing the shape file using the Wizard and see if that fixes it.

Based on Eric's coment and this, I'm going to go ahead and close the issue - but let us know if things don't work out for you.