Quantcast
Channel: DotSpatial Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1128

Commented Feature: DotSpatial.Data.Database (interim) solution [206]

$
0
0
Hello Folks,

I'm aware that Ted is working on some super duper IQueryable database connection
for DotSpatial. For those who do not like to wait, here is a simple, read-only
(that can change) implementation.

It is split up in the following projects
- DotSpatial.Data.Database
Core interfaces and abstract and/or base classes
- DotSpatial.Data.Database.PostGis
PostgreSql/PostGis vector provider
- DotSpatial.Data.Database.SpatiaLite2
SpatiaLite vector provider, x86 native binaries of rc3 and a small sample
SQLite/Spatialite db file.
- ExternalReferences
Npgsql, Mono.Security, SQLite.Net

Other spatial database stores could be done in a similar way.

I think setup is straighforward, extract the zipfile to your root DotSpatial
folder, add projects to your solution file, add references to your DotSpatial
app.

To load the layers of the sample file you need to call:
var slvp = new DotSpatial.Data.Database.SpatiaLiteVectorProvider();
map.Layers.Add(slvp.Open("DataSource=<PathToYourFile>;", "countries",
"PK_UID", "geom");
map.Layers.Add(slvp.Open("DataSource=<PathToYourFile>;", "rivers", "PK_UID",
"geom");
map.Layers.Add(slvp.Open("DataSource=<PathToYourFile>;", "cities", "PK_UID",
"geom");


As always, comments are welcome, I'm aware that some of the properties must not
be exposed, but it is late...

One questions at last, where to put stuff like this or the
DotSpatial.Controls.BrutileLayer?

Enjoy,
FObermaier
Comments: Hello I am trying to use the DotSpatial.Data.Database but I keep getting the error Error 2 The type or namespace name 'WKBReader' could not be found (are you missing a using directive or an assembly reference?) C:\Users\OWNER\Documents\DotSpatial.Data.Database\DotSpatial.Data.Database\DbVectorProvider`1.cs 112 47 DotSpatial.Data.Database I will be grateful if someone can point me to how I can resolve this error. Kind Regard Worlanyo

Viewing all articles
Browse latest Browse all 1128

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>