[Qgis-developer] Starting Plugin Development for importing data from BigSense

Sumit's Mailing Lists lists at battlepenguin.com
Thu Sep 17 14:23:13 PDT 2015


Hey there,

I'm the lead developer of BigSense and I really want to write a plugin
for qgis to import data from a BigSense server. I've got qgis running
with some basic shapes for the maps of the areas I'm studying. I've been
looking through a lot of the plugin documentation and I'm not entirely
sure where to start.

Basically, BigSense queries look like the following:

http://example.org/Query/DateRange/20150812/20150813.csv?SensorType=Temperature

and return data that looks like the following:

PackageID,TimeStamp,TimeZone,RelayID,SensorID,SensorType,Units,Data,Longitude,Latitude,Altitude,Speed,Climb,Track,LongitudeError,LatitudeError,AltitudeError,SpeedError,ClimbError,TrackError
261,2015-08-12
14:49:42.673,UTC,VirtualRelay01,FFF34E141400,Temperature,C,31.625,11.573911667,50.924608333,234.7,0.0,0.0,187.85,11.167,15.452,46.0,30.9,,
260,2015-08-12
14:49:27.647,UTC,VirtualRelay01,FFF34E141400,Temperature,C,31.5625,11.573913333,50.924611667,234.3,0.211,0.0,187.85,11.167,15.452,46.0,30.9,,
259,2015-08-12
14:49:11.505,UTC,VirtualRelay01,FFF34E141400,Temperature,C,31.5625,11.573935,50.924686667,231.5,0.365,0.0,184.34,11.167,15.452,46.0,30.9,,
258,2015-08-12
14:48:56.447,UTC,VirtualRelay01,FFF34E141400,Temperature,C,31.5,11.573976667,50.924778333,235.7,0.0,0.0,9.15,11.167,15.452,41.4,30.9,,
257,2015-08-12
14:48:40.313,UTC,VirtualRelay01,FFF34E141400,Temperature,C,31.5,11.573993333,50.924786667,238.7,0.0,0.0,9.15,11.167,15.452,41.4,30.9,,
256,2015-08-12
14:48:25.29,UTC,VirtualRelay01,FFF34E141400,Temperature,C,31.4375,11.573973333,50.924785,239.4,0.041,0.0,9.15,11.167,15.452,41.4,30.9,,
255,2015-08-12
14:48:09.149,UTC,VirtualRelay01,FFF34E141400,Temperature,C,31.4375,11.573933333,50.92475,242.8,0.0,0.0,5.27,11.167,15.452,64.4,30.9,,

Each record contains data from a Relay and a Sensor (a relay can have
multiple sensors. We de-normalize the data, so the output is flattened.
Each package_id only has one time and one GPS data set, but multiple
sensors with their own data and units). Default timezone is always UTC.

I want to make a plugin that can import a dataset into qgis. Basically
it would be a dialog with a field for the BigSense web service end
point, a date/time range (Query/TimestampRange is supported for UNIX
timestamps) and drop downs with constraints. I don't care about keeping
track of what's imported or importing data twice. That's all going to be
in the hands of the user.

Looking at the documentation, I'm assuming what I need to do is start
with "Writing Vector Layers" and create a new layer, add a feature for
each reading, set the Geometry of that reading to a Point from my GPS
(I'm ignoring all readings without GPS data and I'm ignoring all the
_error fields for now too), and set and Attribute for the actual data
("temperature" - > 15.6C) and then add that feature to the writer?

Is that correct? Am I on the right track? Are there any examples of data
imports up on github or in the documentation that I've missed that fit
this use-case?

Thanks.



More information about the Qgis-developer mailing list