Create a Shapefile

You can use shapefiles to store geospatial vector data such as, location, shape, and attributes of geographic features. You can create a shapefile from a CSV file using a Geographic Information System, such as QGIS.

Let's look at an example to understand the use of shapefiles.

John Smith is a field technician who wants to know if there are any work zone gaps related to the areas assigned to him. He can create a shapefile from a CSV file and add it to the map to see the boundaries of the workzones and identify the work zone gaps.

You can create a shapefile from a CSV file as follows:

  1. Prepare a CSV file.
  2. Import CSV file to QGIS layer.

    Note:

    Before you import the CSV file, you must validate the data against the Requirements for Geometric Data.
  3. Perform the following tasks to export the layer to a shapefile:
    1. Click Layer, and then Save As.
    2. Select ESRI Shapefile in the format drop-down list.
    3. Select Coordinate Reference System, for example, EPSG: 4326 is SRID 4326.

      Note:

      The recommended SRIDs are 3785, 3857, 4326, 8307, 32775, 53004, 54004, 505050, and 1009801.
  4. Create a ZIP archive containing all the files created by QGIS during the shapefile export.

Note:

For more information about shapefiles, refer to About Shapefiles.

Requirements for Geometric Data

You must validate the data against the SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT function. This function validates the representation of the geometry against the element definitions and returns the context of the error if it's invalid. Here are the requirements for geometric data:

  • Polygons must have at least four points including the point that closes the polygon. The last point must be same as the first point in the polygon.
  • No two vertices on a line or polygon have a distance that is less than or equal to 5 centimeters between them.
  • Points on an arc aren't collinear (that is, aren't on a straight line), and no two vertices on a line have a distance less than or equal to 5 centimeters between them.
  • Polygons must not be crossed.
  • No two vertices on a line or polygon are the same.
  • Polygons must be oriented correctly. Exterior ring boundaries must be oriented counter-clockwise and interior ring boundaries must be oriented clockwise.
  • The interior of a polygon must be connected.
  • Line strings must have at least two points.

You must validate the data against these requirements before you import the data. If the data doesn't comply with the requirements, Oracle Field Service normalizes the data during the import process. Normalization of data may result in some noncompliant shapes being displayed incorrectly or shapes not being displayed at all. If you run into any issues with the shapes or with import after an upgrade, try to import the data again before creating a service request.

Oracle Field Service supports spatial elements as small as 5 centimeters, however, for shape geometries, the points must have a distance of at least 5 meters between them.

Obtaining a Spatial Reference System Identifier (SRID)

Spatial Reference System Identifier (SRID) is used to identify projected, unprojected, and local spatial coordinate system definitions. When you upload a shapefile using the Metadata API, the request must contain the same SRID as the shapefile. You can obtain the SRID using the QGIS mapping tool as follows:

  1. Open QGIS and add a Vector Layer.
  2. Select a shapefile.
  3. Open the Properties window for the imported layer.
  4. Identify the SRID.

Note:

The recommended SRIDs are 3785, 3857, 4326, 8307, 32775, 53004, 54004, 505050, and 1009801.