Closed jskulavik closed 9 years ago
Looks like that should work if you installed via the nuget packages.
"C:\mapnik-v2.2.0\lib\mapnik\input"
That is definitely not going to work. NETMapnik targets mapnik-sdk v3.0. Loading plugins from a previous version will not work.
There is not really a ton for me to go off here. I'd like to help but there is not much i can do unless you post a full working test case. For example, Here is a quick test case i set up too check your code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NETMapnik;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
string input = @"{
type: ""Feature"",
properties: {},
geometry: {
type: ""Polygon"",
coordinates: [[[1,1],[1,2],[2,2],[2,1],[1,1]]]
}
}";
JObject geojson = JObject.Parse(input);
DatasourceCache.RegisterDatasources(@".\mapnik\input");
Dictionary<string, object> options = new Dictionary<string, object>()
{
{ "type","csv"},
{ "inline", "geojson\n'" + geojson["geometry"].ToString(Formatting.None) + "'" }
};
Datasource ds = new Datasource(options);
Console.ReadLine();
}
}
}
This compiles and executes without error
not found DatasourceCache!! why?
Thanks again for all of the help @jbrwn.
I'm successfully loading NETMapnik into x64 .NET 4.5.1 now, but running into the exception:
Could not create datasource for type: 'csv' (no datasource plugin directories have been successfully registered)
With both ".\mapnik\input" and "C:\mapnik-v2.2.0\lib\mapnik\input" supplied to DatasourceCache.RegisterDatasources then subsequently trying to instantiate a csv plugin.