GIS Providers – Guide & Recipes¶
Applies to GeoServer (WFS), MCLite, MIKECloud, MIKECore (DFS2/DFSU), and ShapeFile. Use this page to pick the right provider fast, and wire it up. Deep dives live in the provider-specific guides.
See for more details¶
Quick map of the providers (the big picture)¶
| Provider | Kind | R/W | “Groups” mean… | Where data lives | Best for / notes |
|---|---|---|---|---|---|
| GeoServer (WFS → FeatureCollection) | Ungrouped | Read | n/a (use Group = workspace) | GeoServer WFS (GeoJSON) | Fetch features from WFS via templated URL. GetIds() lists layers via /rest/layers. |
| MCLite FeatureRepository | Grouped | Read/Write | MCLite folders | DB (PostgreSQL/SQLite/SQL Server) | Full CRUD on collections/features/attributes; metadata; optional XML metadata search; KML* |
| MIKECloud GroupedGisRepository | Grouped | Read/Write | Projects / Subprojects | MIKECloud vector datasets | Create/read vector datasets via Transfer. Listings OK; per-feature CRUD is limited (see notes) |
| MIKECore DFS2 FeatureRepository | Ungrouped | Read | n/a | DFS2 file | Turns a time slice into polygons per cell. Requires DateTime=…. |
| MIKECore DFSU FeatureRepository | Ungrouped | Read | n/a | DFSU file/folder | Mesh → polygons per element. Optional Item=…, DateTime=…. Can enumerate *.dfsu. |
| ShapeFile FeatureRepository | Grouped** | Read/Write | OS folders (when in folder mode) | .shp/.shx/.dbf (+ .prj) |
Read/write shapefiles; simple Equal filtering; writes .prj from Metadata["Projection"]. |
- KML streaming only on PostgreSQL.
Note
“Grouped” here means “folder-based IDs” when you point the repo at a folder.
Which one should I pick?¶
- Pull features from an existing GeoServer/WFS → GeoServer (WFS)
- Database-backed, full CRUD + search → MCLite
- Cloud project datasets (create/read; listings) → MIKECloud (Grouped)
- Turn rasters/meshes into feature polygons → MIKECore (DFS2/DFSU)
- Read/write shapefiles on disk → ShapeFile
Capabilities at a glance¶
| Capability / API | GeoServer | MCLite | MIKECloud (Grp) | DFS2 | DFSU | ShapeFile |
|---|---|---|---|---|---|---|
Get(id) → FeatureCollection<string> |
✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
GetAll() / group listings |
✗ | ✓ | ✓ | ✗ | ✓ | ✓* |
| Metadata search / filters | “n/a” | ✓** | (limited) | ✗ | ✗ | Equal/OR |
| Feature CRUD (add/update/remove single feature) | ✗ | ✓ | AddFeature✓ | ✗ | ✗ | ✓ |
| Attribute DDL (add/update/remove columns) | ✗ | ✓ | ✗ | ✗ | ✗ | ✓ |
| Associations (TS/Docs/Sheets) | ✗ | ✓ | ✗ | n/a | n/a | ✗ |
| Envelope / Footprint | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ |
Reprojection on read (outSrid) |
n/a | n/a | ✓ | ✗ | ✗ | via .prj |
- ShapeFile “listings” happen by pointing the repo at a folder.
Note
MCLite supports token AND across values, plus optional XML metadata search.
IDs & groups — mental model (cheat sheet)¶
-
GeoServer (WFS) — semicolon
key=valuepairs:Group=<workspace>;Layer=<layer>;Crs=EPSG:XXXX;BoundingBox=xmin,ymin,xmax,ymax[;Time=…][;Size=w,h]You provide a templated query with placeholders like[group],[layer],[crs],[boundingbox]. -
MCLite — full path:
"/Group/Sub/Name"(grouped). DB stores geometry + attributes; CRUD and search supported. -
MIKECloud (Grouped) — full path:
"Group/Sub/Name"under a project; repo creates missing subprojects onAdd. -
MIKECore
- DFS2:
DateTime=yyyy-MM-ddTHHmmss[;File=…][;BoundingBox=xmin,ymin,xmax,ymax] - DFSU:
[File=…][;Item=…][;DateTime=…][;BoundingBox=…](unknown keys throw)
- DFS2:
-
ShapeFile — either a folder (IDs look like
"roads/primary.shp") or a single file repo (ID is the file).
For providers that use folder-style IDs, follow your host’s URL encoding rules (often
/→|). See your GIS Web API guide.
Registering providers (minimal wiring)¶
All controllers resolve services by connectionId from
ServiceLocator.
GeoServer (WFS)
using DHI.Services; using DHI.Services.GIS;
using DHI.Services.Provider.GeoServer;
var query = "[group]/ows?service=WFS&version=1.1.0&request=GetFeature" +
"&typeName=[group]:[layer]&srsName=[crs]&bbox=[boundingbox]&outputFormat=application/json";
ServiceLocator.Register(
new GisService(new FeatureCollectionRepository(
baseUrl: "https://my.gs/geoserver/", query: query, userName: "user", password: "pass")),
"geoserver");
MCLite (grouped, updatable)
using DHI.Services; using DHI.Services.GIS;
using DHI.Services.Provider.MCLite;
ServiceLocator.Register(
new GroupedUpdatableGisService(new FeatureRepository(
"dbflavour=PostgreSQL;host=localhost;port=5432;database=mc_ws;username=...;password=...;workspace=workspace1")),
"mclite");
MIKECloud (grouped)
using DHI.Services; using DHI.Services.GIS;
using DHI.Services.Provider.MIKECloud;
ServiceLocator.Register(
new GroupedUpdatableGisService(new GroupedGisRepository(
"apiKey=<APIKEY>;projectId=<PROJECTID>;environment=Prod")),
"mc-gis");
MIKECore (DFS2 / DFSU)
using DHI.Services; using DHI.Services.GIS;
using DHI.Services.Provider.MIKECore;
ServiceLocator.Register(new GisService(new Dfs2FeatureRepository(@"C:\data\R20141001.dfs2")), "dfs2");
ServiceLocator.Register(new GisService(new DfsuFeatureRepository(@"C:\data\dfsu\")), "dfsu");
ShapeFile (folder or file)
using DHI.Services; using DHI.Services.GIS;
using DHI.Services.Provider.ShapeFile;
// Folder mode (list many)
ServiceLocator.Register(new GisService(new FeatureRepository(@"C:\data\shp")), "shape");
// Single-file mode (write one)
ServiceLocator.Register(new GisService(new FeatureRepository(@"C:\data\roads.shp")), "roads-one");
Optional: configure via connections.json (snapshots)¶
{
"geoserver": {
"$type": "DHI.Services.GIS.WebApi.GisServiceConnection, DHI.Services.GIS.WebApi",
"RepositoryType": "DHI.Services.Provider.GeoServer.FeatureCollectionRepository, DHI.Services.Provider.GeoServer",
"ConnectionString": "BaseUrl=https://my.gs/geoserver/;Query=[group]/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=[group]:[layer]&srsName=[crs]&bbox=[boundingbox]&outputFormat=application/json;UserName=user;Password=pass",
"Name": "GeoServer WFS",
"Id": "geoserver"
},
"mclite": {
"$type": "DHI.Services.GIS.WebApi.GroupedUpdatableGisServiceConnection, DHI.Services.GIS.WebApi",
"RepositoryType": "DHI.Services.Provider.MCLite.FeatureRepository, DHI.Services.Provider.MCLite",
"ConnectionString": "dbflavour=PostgreSQL;host=localhost;port=5432;database=mc_ws;username=...;password=...;workspace=workspace1",
"Name": "MCLite (grouped, updatable)",
"Id": "mclite"
},
"mc-gis": {
"$type": "DHI.Services.GIS.WebApi.GroupedGisServiceConnection, DHI.Services.GIS.WebApi",
"RepositoryType": "DHI.Services.Provider.MIKECloud.GroupedGisRepository, DHI.Services.Provider.MIKECloud",
"ConnectionString": "apiKey=[env:MIKECLOUD_APIKEY];projectId=[env:MIKECLOUD_PROJECT];environment=Prod",
"Name": "MIKECloud (GIS)",
"Id": "mc-gis"
},
"dfs2": {
"$type": "DHI.Services.GIS.WebApi.GisServiceConnection, DHI.Services.GIS.WebApi",
"RepositoryType": "DHI.Services.Provider.MIKECore.Dfs2FeatureRepository, DHI.Services.Provider.MIKECore",
"ConnectionString": "[AppData]dfs2\\R20141001.dfs2",
"Name": "DFS2 reader",
"Id": "dfs2"
},
"dfsu": {
"$type": "DHI.Services.GIS.WebApi.GisServiceConnection, DHI.Services.GIS.WebApi",
"RepositoryType": "DHI.Services.Provider.MIKECore.DfsuFeatureRepository, DHI.Services.Provider.MIKECore",
"ConnectionString": "[AppData]",
"Name": "DFSU reader",
"Id": "dfsu"
},
"shape": {
"$type": "DHI.Services.GIS.WebApi.GisServiceConnection, DHI.Services.GIS.WebApi",
"RepositoryType": "DHI.Services.Provider.ShapeFile.FeatureRepository, DHI.Services.Provider.ShapeFile",
"ConnectionString": "[AppData]shp",
"Name": "Shapefile",
"Id": "shape"
}
}
If you use
[AppData], set once at startup:AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(builder.Environment.ContentRootPath, "App_Data"));
Tips¶
-
GeoServer
- Must call WFS (GeoJSON) endpoints; WMS (images) is used at GIS Maps.
- If your template uses
[width]/[height], the ID must includeSize=w,h. Timeappends with 12-hourhhin the built-in logic; if you needHHuse your own placeholder.
-
MCLite
- Server-side filter supports
QueryOperator.Equalonly; tokenized AND search applies to metadata APIs. - KML streaming is PostgreSQL-only.
- Geometry normalized to Multi* on write; plan your symbology accordingly.
- Server-side filter supports
-
MIKECloud (Grouped)
associations:trueonGet→ throws (not supported).outSridmust be an int string (e.g.,"4326"); otherwise throws.- Per-feature CRUD beyond
AddFeatureisn’t implemented yet.
-
MIKECore
- DFS2
DateTimeformat isyyyy-MM-ddTHHmmss(no colons). - DFSU: unknown ID keys throw; use
BoundingBox, notBBox. - Bounding boxes are full containment (all vertices inside) for both DFS2/DFSU.
- DFS2
-
ShapeFile
- Read filtering is Equal only; multiple filters are OR’d.
.prjis written fromMetadata["Projection"]if present and not a known “local/none” marker.