-1

How are police officers and emergency workers sending details of a situation with a location on the map?

I'm developing a WCF service that recieves data with location details from a client with an android app. So I thought that an android app can send a KML file as the data with location details of a situation (pinpointed on a map from android app). Then this KML file is recieved by the WCF service which stores it in file system with its file path referenced in a database.

Not sure if this is the best way to go about it. This is a question at the high level. Once I get replies about a sensible way of doing this, I will ask more specific coding questions. Thanks.

Qwerty
  • 323
  • 1
  • 6
  • 33
  • Why was this question down voted? Did it offend anyone?? Or is it not "specific" enough? Go down vote someone else's question...>. – Qwerty Jan 17 '12 at 01:38

1 Answers1

0

If you can get latitude & longitude out of the KML file and you're using SQL Server 2008+, you can store the information in a column with the Geography data type. You can also store the KML file itself in a Filestream column. Or both!

Ben Thul
  • 31,080
  • 4
  • 45
  • 68
  • OK thanks for the reply. I prefer to store the KML file in a Filestream column itself. I have set the column data type as varbinary(max). I just need to enable Filestream. How is the file data identified in the file system? In the table with varbin. column I have used a id column, will this be able to identify the file data (ie. a KML file)? – Qwerty Jan 11 '12 at 20:53
  • Are you asking how you get the path to the file that you've stored? If so, http://technet.microsoft.com/en-us/library/cc645940.aspx will be helpful. Specifically, the bit about the PathName() method. – Ben Thul Jan 12 '12 at 01:50
  • Yes, ok. So for example, if I wanted an event's kml or image file from a database then would I find the event from id column in event table and extract the filepath (as a string) from that row in database? If so then is the path file column to be stored as a nvarchar(max) in the SQL server 2008 database? – Qwerty Jan 13 '12 at 04:20
  • Not quite. FILESTREAM columns store the contents of the file on the file system (outside of the "normal" database file(s)), but make it appear as though it's stored in SQL Server. Let's say that you stored a jpeg in the column. If you were to query the table (and you had an appropriate viewer), you'd see the JPEG. The beauty of it is that the data doesn't hit the buffer cache, so you don't incur that penalty. But you're right about querying the table by id to find the data you're looking for. – Ben Thul Jan 13 '12 at 15:47