Tutorials CivilCraft help Walkthroughs
Import GIS data
Bring shapefiles, GeoJSON and GeoPackages into a project as GIS layers, place them through the right coordinate system, look at their attributes, and use them for the surface.
Written for CivilCraft 0.3. The same help is inside the app: press F1.
City and county GIS departments hand out site context as GIS files: parcels, easements, contours, utilities, survey control. CivilCraft opens three kinds of them as GIS layers that sit under your design on the plan.
| File | What to open |
|---|---|
| Shapefile | The .shp together with its .shx, .dbf, .prj and .cpg (select them all), or the .zip they came in. A zip holding several shapefiles gives several layers. |
| GeoJSON | The .geojson file (a .json file whose first lines say FeatureCollection or Feature works too). |
| GeoPackage | The .gpkg file. Every feature table in it is listed. |
Points, multipoints, lines, polygons with holes and multi-part shapes are read, with their elevations (z) when the file has them. Measure (M) values are left out. Elevation grids and LiDAR open the same way: see Elevation grids and LiDAR.
Open the files
- Click Import in the GIS group (or Open), choose the files, or drop them on the plan. The files are read on this computer; nothing is uploaded.
- The Import GIS data dialog lists every layer found: its kind, how many features (and how many have no geometry), how many attribute fields, and the coordinate system the file names. Untick the layers you do not want.
- Read the Coordinate system part (below) and the What will happen line, then click Import.
- The layers appear on the plan and under GIS layers in the left panel. The import is one step: ⌘ZCtrl+Z takes it back.
A large file shows a progress line over the plan with a Cancel button.
The coordinate system
GIS files say where they are through a coordinate system (a shapefile's .prj, a GeoPackage's spatial reference table; GeoJSON is always latitude and longitude). CivilCraft converts each layer from its own system into the project's. It never guesses:
- The project has a coordinate system (set in Coordinates): every layer with a system of its own is converted into it, including a ground or local adjustment. A file with no
.prjgets two choices: Same as the project (its numbers are loaded as they are) or Pick the file's system. - The project has none, and the file is in a projected system in your project's units (a state plane zone in US survey feet for a feet project, for example): the dialog offers Use that system as the project's coordinate system. It is set in the same undo step as the import. Nothing in the project moves; the system only says what the numbers mean. You can pick another system for the project instead, and the layers are converted into it.
- The project has none, and the file is in latitude and longitude (every GeoJSON) or in other units: Import stays grayed out until you choose the project's coordinate system. The picker starts near the data.
- Neither the project nor the files name a system: the numbers are loaded as they are, and the dialog says so.
Elevations are converted too: GeoJSON heights are metres (the GeoJSON standard says so); other files' heights are taken in the unit of their own system.
NAD83 is treated as the same as WGS 84 (the system GeoJSON uses); the two differ by a few metres in North America, so GeoJSON data can be off by that much. Grid shift files (such as NADCON for NAD27) are not used: where the best shift needs one, CivilCraft uses a rougher published shift and the coordinate system dialog shows how rough (for NAD27, about 20 m).
GIS layers
Each row under GIS layers has:
- a checkbox to show or hide the layer (hidden layers are not picked either);
- its colour, chosen from the list;
- a menu (the three dots) with Zoom to, Use for the surface…, Rename… and Remove.
Showing, hiding, recolouring, renaming and removing are undo steps. GIS layers are saved in the project file and come back when you open it. They also go out with the plan's PDF plot and its DXF and DWG exports, each on a layer named GIS- and its number.
Look at a feature
With Select on, click a feature. Properties shows its layer, which feature it is, its shape (parts, holes, vertices), its elevations, the file it came from and that file's coordinate system, then every attribute in a table. Attributes are read-only: CivilCraft shows GIS data as it came, it does not edit it.
Points win over lines when both are under the pointer; inside a polygon, the smallest polygon is picked.
Use for the surface
Open a layer's menu and choose Use for the surface… (or the button in Properties). What is offered depends on the layer:
| Layer | Can become |
|---|---|
| Lines with elevations (3D lines) | Breaklines at their own elevations |
| Lines without elevations but with a number field (contours) | Breaklines at the elevation in the field you pick |
| Polygons | The surface boundary (the selected polygon, else the largest), or breaklines along their edges |
| Points with elevations, or with an elevation field | Survey points, described with the layer's name so they form a point group |
Each use is one undo step that copies the geometry into the project; the layer itself stays as it is. Elevations are taken in project units.
Point files with latitude and longitude
A point file whose header names latitude and longitude columns (lat, latitude, lon, long, longitude) is read as degrees, not as northing and easting. The import dialog says so. On Import, the points are converted to the project's coordinate system; a project without one asks you to choose it first. Degrees are never loaded as feet. Rows outside ±90° latitude or ±180° longitude are refused with the reason. The elevation column is taken as it is, in project units.
LandXML files that name a coordinate system
When a LandXML file you open has a CoordinateSystem element (an EPSG code, a WKT description or a system name), CivilCraft offers it as the project's coordinate system. Nothing moves if you accept; the system only says what the numbers mean.
What was checked
- Every reader was compared with GDAL, the library most GIS programs use to read these files, on files GDAL wrote: shapefiles of every kind with and without elevations, multi-part lines, polygons with holes, empty geometries, text, number, date and true/false attributes, UTF-8 and Windows-1252 text with and without a
.cpg, a zip of several shapefiles, GeoJSON with every geometry type, and a GeoPackage with four tables. Every geometry, elevation and attribute matched. - Positions converted from latitude and longitude, and from UTM, matched PROJ (the projection library behind GDAL) to 3 mm.
- Damaged files (cut short, lying about their sizes, bad zips, bad GeoPackages) give one plain message; nothing hangs.
- Nothing here has been opened in other GIS programs yet, and file geodatabases, KML and KMZ are not read yet (see Not built yet).