0

I am in the ag field and no time or resources for learning or buying GIS to solve one problem.

I have a shapefile that came off a Raven monitor in a tractor that was used to plant a crop.

I use AgLeader SMS to pull the shapefile in and then I can analyze aspects of it as it relates to agriculture.

The problem I am having with 1 shapefile, in particular, is its projection when I read it in.

I have figured out the centre of the projection is in Mexico while my field is in Iowa and the field is such a small speck on the map, I cannot find it.

I have made a copy of the files and have opened the .dbf file with MS Access and have found by sorting that there are 3 records that contain 0.000 in the Lat field. I have tried to delete those records and save the database as a dBase III, IV and 5 file and SMS will not read it in now.

Am I missing something here on how the .dbf, .shp, .shx and .prj files are linked? Is there an easier way to edit these? I know the data is there, it has over 13,000 records.

  • Am I missing something here on how the .dbf, .shp, .shx and .prj files are linked? I think the answer here is probably yes, a shapefile isn't a single file it's a collection of files see en.wikipedia.org/wiki/Shapefile. – nmtoken Sep 10 '18 at 17:18
  • 1
    Todd Vohs, can you please share some images of your progress so far? I did not get the point about SMS which you have described. – Taras Sep 11 '18 at 4:37
  • How do I share images on this site? I don't see where I can upload anything. – Todd Vohs Sep 11 '18 at 20:28
3

Simply put you can't do that, there is no explicit link between the shapes and the dbf file. They are just read in order so if you delete 3 records then the files are different lengths and will not match up.

So you need to use some GIS software, probably Qgis is easiest, install it the drag and drop the shapefile in. Then select the broken points and delete them and select export and save the shapefile with a new name.

  • Well, that didn't work either. I downloaded QGIS, drug the file into and it opens just fine (snaps right to the field). I could find my 3 records that were zero's and deleted them and exported out to a new shapefile but my SMS still opens the same with a view set at some ungodly big number. I don't know what is going on. Is there anything else that would cause something like this? If you want to see for yourself, SMS can be downloaded from agleader.com and has a trial version. I would send the shapefile to whomever, there is nothing confidential in it. – Todd Vohs Sep 10 '18 at 18:44
  • @ToddVohs - using QGIS, can you see what coordinate system / spatial reference system your datasets are in? It might be that QGIS 'knows' where to draw your data in relation to other data layers (you said it snaps right to your field in Iowa, but do yo have another layer in QGIS that has set the coordinate system of the map?). What I might try is to take your 'bad' data, once its loaded in the correct spot as your Iowa data, export it as a new shapefile and explicitly set the coordinate system to WGS84/ SRID 4326 - then give that a try. – DPSSpatial Sep 10 '18 at 20:19
  • Well, now I cannot get it to load. It actually loads but just like it does in SMS, I think. I just have a white screen. I open QGIS, start a new project and drag the shapefile into the main screen area, it appears in the Layers list in the bottom left but screen is now all white like it lost its projection too. Not sure what I did the first time but it was exactly what I did this time too. I am at a loss now. – Todd Vohs Sep 10 '18 at 21:28
0

RE the QGIS 'white screen'/now invisible layer -

in the layers panel (usually situated on the left of the main window) try right clicking the layer name and selecting 'zoom to layer' this should draw your layer regardless of its projection. If it doesn't match the projection of the data frame, it will likely display some absurdly high numbers in the coordinates/scale.

I suggest that you try right clicking your layer name again, and selecting 'set project CRS from layer', which should reconcile the data CRS with the data frame CS.

On QGIS 3 (and I presume earlier versions too), the data frame CRS should be displayed in the bottom right corner of the screen. The current data projection sounds like it may not be the most suitable choice for your purposes, perhaps another user could suggest an appropriate CRS for your location, unfortunately I am not familiar with North American projections.

If you know what CRS you require, it may help to delete the existing .prj file before opening in QGIS, and then setting the CRS by right clicking the layer > 'set layer CRS'. QGIS seems to be quite good at switching between projections issue free, but in my experience with ArcGIS it isn't often as straight forward and the pre-deletion of the .prj tends to help - it certainly won't hinder your efforts either way.

  • Okay, the Zoom to Layer does not work. If I right click on the layer and Set Project CRS from Layer, I get the same thing. I renamed the .prj file and tried it again and it asks me for the projection. I don't know what it is but have tried 3 different ones. I don't see how I can upload a file or I would put some screen shots on here. If I open the .dbf file in Excel or Access, I can see about 40 lines that have no coordinates in them. I did notice when did get it to open last time that there is a spot in the field where the monitor must have messed up. – Todd Vohs Sep 11 '18 at 18:43
  • and did not record anything so I am fairly confident these records are what is messing it up. I would even upload the original files if I could figure out where I could do it so that someone else could take a stab at it. – Todd Vohs Sep 11 '18 at 18:44
  • I can get it to open in ArcGIS Online but I have to do it as a hosted layer. I can see where the 0 or no value lines are but I don't know how to edit a hosted layer. I can view the table but do not see where to edit and then save the data. I can add to it but not delete. – Todd Vohs Sep 11 '18 at 21:13
  • Todd - you mention that the .dbf has the coordinates listed. Are these definitely coordinates, as in they are maximum 3 digits left of the decimal point? Or are they much longer numbers, 6-8 digits left of decimal? If it is the former, your data is in a GCS, and the most commonly used projection would be WGS1984 (as mentioned above by dpsspatial). – Maggie Sep 12 '18 at 10:52
  • If this is the case, close QGIS, and in your local drive where the file is stored - delete the associated .prj files. Open a fresh QGIS project, drag/drop your .shp, right click layer > properties > source > select CRS (this is a small unlabelled pic of a globe in v3.0). Set this to WGS1984. – Maggie Sep 12 '18 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.