How do I export QGIS point data?

Shapefiles

Raster Data

If you have a georeferenced image or aerial imagery, you will need to import them using the Add Raster Layer button.  To import a raster file, follow these steps:

  1. Click on the "Layer" menu, mouse-over "Add Layer" and click on "Add Raster Layer..." or click on the "Add Raster Layer icon in the left column of QGIS.            
    How do I export QGIS point data?
  2. You will automatically be directed to your folders.  Go to the folder where your rasters are stored and change the raster data type if needed by click on the drop-down menu next to the file name.            
    How do I export QGIS point data?
  3. Click Open.

CSV file

Once the csv files are formatted properly, you can add them into QGIS.  

  1. Click on the "Layer" menu, mouse-over "Add Layer" and click on "Add Delimited Text Layer..." or click on the "Add Delimited Text Layer" icon in the left column of QGIS.               
    How do I export QGIS point data?
  2. The next GUI will have many different options you may need to change depending on the specific data set you have.  Here is an outline of the most common fields needed to be changed.      
    1. Browse - click on Browse and find the folder where the csv file is saved and open the file.
    2. Layer name - the name of the CSV will show up here.
    3. File format - depending on the version of QGIS you are using, you may need to verify the file format.
    4. Geometry definition - If you have x, y coordinates you will choose the "Point coordinates" option.  Verify the X Field is pointing to your Longitude field and the Y Field is pointing to your Latitude Field.  If you have a table with no x,y coordinates you will choose the "No Geometry" option.
    5. Layer settings - you will see a preview of the table.  Verify that everything looks correct.  
      How do I export QGIS point data?
  3. Click OK.
  4. If you have a field with no x, y coordinates you are done importing the csv file.  However, depending on the version of QGIS you are using, you may be prompted to define the coordinate reference system (CRS) of your x, y coordinates.  Longitude/Latitude coordinates are unprojected, and you should choose the CRS of WGS 84 (EPSG:4326). If you have coordinates using something else, like meters in a UTM zone, search for that using the filter box in the CRS Selector Dialog.  For instance, type in <utm 17> to get a short list that includes the UTM zone for Durham, 17N (e.g., NAD83 / UTM zone 17N, or EPSG:26917).
    How do I export QGIS point data?

If you want to use spatial data that you created in nodegoat in a geographic information system (GIS) application like QGIS, you can export your data as a CSV file or query the nodegoat API. In both cases, you end up with one or multiple files that you then can process and work with in a GIS application.

In this guide we will describe a more dynamic approach: use the Python console in QGIS to pull in data from your nodegoat environment. This approach allows you to use nodegoat as your primary data store and instantly update your QGIS project whenever you want to load in the most recent version of your data.

To make this work, first configure the API of your research environment in such a way that you can run queries to fetch the spatial data you want to use in your GIS application. You should have enabled at least one project in the API settings, and you should have configured at least one active client and one active user who has access to the enabled project.

The identifiers of Objects, Object Types, Scopes, or Filters (and any other nodegoat element) are shown under the name of the element when you edit or view the element in nodegoat. You will use these identifiers to construct the API queries.

If you do not have access to the API module that can be accessed via 'Management', please contact the administrator of your nodegoat environment or send a message to .

Before you start querying the API from your GIS application, it is recommended to first run your query as a cURL command to confirm that the requested data is correctly returned. For example:

curl https://nodegoat.io/data/type/[Your Object Type ID]/object&limit=1 -H 'Authorization: Bearer [Your Passkey]'

Connect QGIS to nodegoat  

To use the response data in QGIS: start a new project and go to 'Plugins > Python Console'. Click the 'Show Editor' button in order to be able to write and run a python script.

The first section of the script fetches your data from the nodegoat API:

import requests # Import the requests library to make HTTP requests 
query_url = 'https://nodegoat.io/data/type/[Your Object Type ID]/object' # The nodegoat API request URL 
passkey = '[Your Passkey]' # Your passkey
request = requests.get(query_url, headers={'Content-Type':'application/json', 'Authorization': 'Bearer '+passkey}) # Fetch the data
json_data = request.json() # Format the response as JSON
objects = json_data['data']['objects'] # Go to the position in the response data that contains the list of returned Objects

Next, create a point layer that can host the returned data:

point_layer = QgsVectorLayer('Point?crs=EPSG:4326', 'Point Layer', 'memory') # Create a point layer using the EPSG:4326 code
point_layer.dataProvider().addAttributes([QgsField('id',  QVariant.Int), QgsField('label', QVariant.String)]) # Add attributes for IDs and Labels
point_layer.updateFields() # Enable the newly created fields
QgsProject.instance().addMapLayer(point_layer) # Add the newly created layer to your current project

Finally, iterate over the returned Objects and Sub-Objects in order to add the geometry data to the newly created layer:

for object_id in objects: # Iterate over the returned Objects

  for object_sub_id in objects[object_id]['object_subs']: # Iterate over the Sub-Objects of each Object

    string_geometry = objects[object_id]['object_subs'][object_sub_id]['object_sub']['object_sub_location_geometry'] # Get the geometry data

    if string_geometry: # Check if the Sub-Object has geometry data

      geometry = QgsJsonUtils.stringToFeatureList(string_geometry, QgsFields(), None) # Create a feature list based on the returned GeoJSON data
      geometry[0].setAttributes([object_sub_id, objects[object_id]['object']['object_name']]) # Assign attributes to the newly created feature
      point_layer.dataProvider().addFeatures(geometry) # Add the feature to the point layer

point_layer.updateExtents() # update the layer

Paste these three sections of the script in the editor. Click the 'Run Script' button to fetch and display your nodegoat data in your QGIS project. Enable the 'Show Labels' option to display the returned Object Names as labels.

To include geometries of related Objects, you set a Scope that follows a reference to a related Object Type containing spatial data.   Follow the guide 'Manage your Visualisation' to learn more about the Scope functionality. Store this Scope and use its identifier in your query, e.g.: 'https://nodegoat.io/data/type/[Your Object Type ID]/scope/[Your Scope ID]/object'.

Update the part of the scripts that iterates over the Objects and Sub-Objects to this:

for object_id in objects: # Iterate over the returned Objects

  object = objects[object_id] 

  if 'cross_referencing' in object: # Check if Cross-Referencing Objects exist

    for cross_referencing_object_id in object['cross_referencing']:  # Iterate over the Cross-Referencing Objects

      cross_referencing_object = object['cross_referencing'][cross_referencing_object_id]

      for object_sub_id in cross_referencing_object['object_subs']: # Iterate over the Sub-Objects of each Cross-Referencing Object

        object_sub = cross_referencing_object['object_subs'][object_sub_id]
        string_geometry = object_sub['object_sub']['object_sub_location_geometry'] # Get the geometry data

        if string_geometry: # Check if the Sub-Object has geometry data

          geometry = QgsJsonUtils.stringToFeatureList(string_geometry, QgsFields(), None) # Create a feature list based on the returned GeoJSON data
          geometry[0].setAttributes([object_sub_id, object['object']['object_name']]) # Assign attributes to the newly created feature
          point_layer.dataProvider().addFeatures(geometry) # Add the feature to the point layer

point_layer.updateExtents() # Update the layer

How do I export coordinates from GIS?

(1) On the menu bar, select Vector -> Geometry Tools -> Extract Vertices. A popup box will ask which layer you wish to extract nodes from, and how you want to save the new layer. Click OK, and a new points-only layer should appear.

How do I export shapefile coordinates?

Export coordinates.
Click the Export button in the Coordinate Conversion pane..
Click the button for the format to which to export the collected coordinates—this could be feature class, shapefile, KMZ, or CSV—and click OK..
Browse to the location where you want to store the output and click Save..

How do I create a point file in QGIS?

Map Coordinates with QGIS Click the down arrow next to the icon and select “add new shapefile” from the options. From the pop-up window select point. You can also change the coordinate system (the default is the set coordinate system of your QGIS file) and add any attribute fields you want. Hit the “ok” button.