1

Completely new to GIS so this may be the most basic thing in the world however I've followed several other posts on the same question and it does not seem to be working.

My end goal(hopefully) is to take the files(.shp, .dbf, etc) that I've downloaded from the NHESP and turn certain habitats into lat and long values in a .csv.

Basically, I'm trying to determine if bee-hive distance to core habitats etc makes an impact on health, ability to survive, etc(if anyone cares).

I've tried using the field calculator to generate an X & Y coordinate, as well as the "save vector layer as" and changing the geometry to "as_xy."

Is there something I'm missing, or is it possible the files I have simply cannot generate or do not contain the information needed for lat/long?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
DataDog
  • 111
  • 1
  • 4
    Are your habitats point or polygon? Why not perform a nearest calculation (distance matrix http://www.qgistutorials.com/en/docs/nearest_neighbor_analysis.html) for each beehive to the nearest habitat(s) and save that as a table? That way you will know for each hive what habitat(s) are close and how far they are. To do this properly you should have both the hive and habitat as a suitable projected coordinate system. I care about bees, of the insects they are one of the most ecologically significant for their role in pollinating plants and generating honey as an aside. – Michael Stimson Feb 22 '18 at 01:31
  • There are two separate sets of habitats, both are polygons.

    I just checked out the link. This is pretty awesome however I think I'm still stuck since I don't have(or at least I don't think I have) the coordinates of the habitats. When I right click the layers and select "attributable table" I see the acreage, shape_area and shape_len. No x,y, etc. however.

    My ultimate goal would be to get the distance into a .CSV so I can toss it into some machine learning algos in R.

    – DataDog Feb 22 '18 at 04:38
  • 1
    You have the geometry (shape) of the features, that is what is being used by distance matrix.. you don't need to do the calculations yourself, the tool will calculate the distance from a hive to the closest vertex in the habitat; you will need to run this twice, once for each set of habitat polygons or merge all the habitats into one feature class. Ensure that the units of your CRS for all feature classes are metres (or feet) as the calculated distance will be in the CRS units. – Michael Stimson Feb 22 '18 at 05:22
  • could you not import the shapefiles into R? – Ian Turton Feb 22 '18 at 09:03
  • Apologies, was tied up with other things:

    @MichaelStimson - Calculated out the distance matrix but something still feels off with the shapefiles. I'm going through the link you sent me but when one of my points is right next to the shape, it's calculating the distance to a farther feature. Finally, have some time to devote to this.

    – DataDog Feb 26 '18 at 22:24
  • It might be time to ask a new question on the distance matrix feature of QGIS, I haven't used it myself, I use Generate Near Table in Esri for this sort of thing so can't really help with interpreting the QGIS tool. You could try sorting the table by distance, it's entirely possible that the table has calculated distances from all hives to all habitats leaving you with too many rows, if you sort for distance ascending you should find the closer habitat distance.. this is how Esri does it so I would anticipate QGIS to be fairly similar. – Michael Stimson Feb 26 '18 at 23:05
  • GOT IT!

    It's not exactly what I wanted but it will have to do for the time being. Basically, I loaded the shapefiles for two types of core habitats, and then plotted the centroids for each one.

    Created new layer with known hives, calculated the distance between hive and centroid for each habitat by feet.

    Time to layer on cell towers and other external information.. Thanks a ton for the help!!

    – DataDog Feb 27 '18 at 01:16

0 Answers0