We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Load shapefile from local storage

Thread ID:





142388 Jan 31,2019 07:41 AM UTC Feb 1,2019 09:51 AM UTC Xamarin.Forms 1
Tags: SfMaps
Christian Rendl
Asked On January 31, 2019 07:41 AM UTC


Is it possible to load shapefiles from local storage in Xamarin Forms sfMaps? I tried both a local path "/data/..." as well as a file Uri "file:///data/..." on Android, however both was not working and gave me a "Java IO Path not found" exception. Any thoughts?

Many thanks,


Bharathiraja K [Syncfusion]
Replied On February 1, 2019 09:51 AM UTC

Hi Christian, 
Greetings from Syncfusion! 
We have the support to load the shape file as stream. Hence, you can achieve your requirement by converting the accessed shape file (from your device location) to stream and load to maps using ReadAsStream() method. 
Please refer the below code snippet for loading shape files as stream. 
// Load Shape file only 
// Load Shape file and dbf file 
ShapeLayer.ReadAsStream(shstream, dbstream); 
We have prepared the sample to load the shape file from the application. Please find the sample from the following location. 
Note: We need to convert the loaded shape file into stream and then load stream into maps. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon