How are you using Spatialite and Xamarin?

1,062 views
Skip to first unread message

John Zastrow

unread,
Dec 2, 2013, 12:08:36 PM12/2/13
to spatiali...@googlegroups.com
Hello,

We are probably going to use Xamarin to build mobile apps with "GIS" capabilities, but we are curious what people have working in terms of geospatial stuff within Xamarin. We're trying to get our heads around some best practices here and the current approaches that are working. We're definitely thinking of building on spatialite, but the Xamarin forums seem a little quiet on doing more than "dots on a map" -  and I'm asking here because folks do seem to be doing spatialite with xamarin.

Is it safe to assume that everyone is displaying geodata into the Google map control? Are you using spatialite's GEOS functions, or just geometry writer/reader parts of the core? Are you encrypting your data? 

 We're not sure what we're up against and what is easy/available already. Our hit list would be as follows, with iOS as our first target:

1. device cache of tiles - based on defined project area
2. device cache of background vectors - based on defined project area or whole layers if small
3. device vectors for adding/editing of points/lines/polygons and attributes PLUS related table attributes
4. wireless sync 

Can you describe the geo-related functions that you've done in your Xamarin app and perhaps generally how you implemented it?  

Thank you!
John

JaakL

unread,
Dec 3, 2013, 2:26:19 AM12/3/13
to spatiali...@googlegroups.com

Most probably Xamarin built-in SQLite does not allow extensions to be loaded, just as iOs and Android bundled ones.

 But it is possible to use native libraries (including Spatialite, SQLite, GEOS etc) in Xamarin apps, and I see no reason why it should not work:
b) Android: http://docs.xamarin.com/guides/android/advanced_topics/using_native_libraries/

We (Nutiteq) have added bindings of our Android maps SDK to Xamarin (please try: https://github.com/nutiteq/xamarin-map-3d), but this does not have yet native libraries like Spatialite included yet. If you are interested, please contact me directly, maybe we could cooperate there.

Jaak

Ko-hei OHTSUKA

unread,
Dec 3, 2013, 11:50:51 AM12/3/13
to spatiali...@googlegroups.com
Hello,

I'm interested in Spatialite on Xamarin, for searching boundaries or polygons. 
I haven't succeed yet.

My solution provides not few global maps but many partial maps (like historical maps, maps in disasters, etc..).
These partial maps have their existing area, so I have to search them in client side.
At last time, I done it by using only GEOS, and check all maps metadata to hit their boundary or polygon, 
in Objective-C.
But it cannot handle many maps and not be used in Android, so I'm searching and testing Spatialite in Xamarin.

I found some native projects in both iOS and Android.
I tried to port them to Xamarin, but I have less knowledge of bindings, so I haven't succeed yet.

If you try to port them to Xamarin, even I have very little knowledge, I want to cooperate with you. 

Regards,

2013年12月3日火曜日 2時08分36秒 UTC+9 JohnZastrow (br8kwall):

JaakL

unread,
Dec 6, 2013, 3:45:20 AM12/6/13
to spatiali...@googlegroups.com
Hello,

Ok, I did it: see http://stackoverflow.com/questions/20419390/how-to-use-spatialite-with-xamarin-on-android/20419391#20419391 , add your comments to that article (or directly to me).

This approach is using java (jsqlite) API between Xamarin C# and Spatialite, which is not the shortest way, but I know how to make Java C# wrappers and I use a .jar library for map display anyway. Working example project with the same samples as in stackoverflow: https://github.com/nutiteq/xamarin-map-3d .Ccloning that project is actually the fastest way to get started.

Jaak

Ko-hei OHTSUKA

unread,
Dec 14, 2013, 2:08:21 PM12/14/13
to spatiali...@googlegroups.com
Hello,

Thank you for binding.
I tried, and it works like a charm.

I was searching some c# Database driver, but most of them are written in sqlite-compatible managed code,
they may be difficult to change to use libspatialite.so.
So, your approach is the best way to use spatialite from Xamarin, at this time, I think.

I searched iOS spatialite with Database driver, 
is based on iOS's famous DB driver FMDB, looks good.
It also can easily implement to Xcode with dependent libraries.

So I am struggling to bind it to Xamarin, but not yet completed..

2013年12月6日金曜日 17時45分20秒 UTC+9 JaakL:

rolandoK

unread,
Jul 15, 2014, 4:59:27 AM7/15/14
to spatiali...@googlegroups.com
Hi Jaak

I cannot find the example you posted with the spatialite xamarin binding. The only version seems to have spatialite removed.

Would you send me the example code for the spatialite xamarin binding?

Thanks

JaakL

unread,
Jul 16, 2014, 2:44:03 AM7/16/14
to spatiali...@googlegroups.com
Hi Rolando,

My original xamarin-map-3d project was refactored (simplified, so it does not have spatialite) and eventually unpublished, but the files you need are available elsewhere. I updated now stackoverflow article http://stackoverflow.com/questions/20419390/how-to-use-spatialite-with-xamarin-on-android/20419391#20419391 links. It is not really direct binding, but binding over java/jsqlite API, which means that it works for Android only. As we have now also Nutiteq maps SDK for iOs, then iOs+Android solution would make sense, and could be done, but it is significant effort. Please email me directly (ja...@nutiteq.com) if you have project for Xamarin with spatialite+maps for iOS and Android. 

Jaak

rolandoK

unread,
Jul 17, 2014, 3:30:42 AM7/17/14
to spatiali...@googlegroups.com
Many thanks Jaak. I am using Android only for now.
Message has been deleted

rolandoK

unread,
Jul 17, 2014, 4:02:25 AM7/17/14
to spatiali...@googlegroups.com
For all those interested the link to use is here:
https://components.xamarin.com/view/NutiteqMapsSDK
Reply all
Reply to author
Forward
0 new messages