@@ -0,0 +1,2412 @@
+package mil.nga.giat.mage.map;%0A%0Aimport java.sql.SQLException;%0A%0Aimport mil.nga.giat.mage.filter.Filter;%0Aimport mil.nga.giat.mage.map.marker.PointCollection;%0Aimport mil.nga.giat.mage.sdk.datastore.DaoStore;%0Aimport mil.nga.giat.mage.sdk.datastore.location.Location;%0Aimport mil.nga.giat.mage.sdk.utils.Temporal;%0Aimport android.content.Context;%0Aimport android.os.AsyncTask;%0Aimport android.util.Log;%0A%0Aimport com.j256.ormlite.dao.CloseableIterator;%0Aimport com.j256.ormlite.dao.Dao;%0Aimport com.j256.ormlite.stmt.QueryBuilder;%0Aimport com.j256.ormlite.stmt.Where;%0A%0Apublic class LocationLoadTask extends AsyncTask%3CVoid, Location, Void%3E %7B%0A    %0A    private Context context;%0A    private Filter%3CTemporal%3E filter;%0A    private PointCollection%3CLocation%3E locationCollection;%0A%0A    public LocationLoadTask(Context context, PointCollection%3CLocation%3E locationCollection) %7B%0A        this.context = context.getApplicationContext();%0A        this.locationCollection = locationCollection;%0A    %7D%0A       %0A    public void setFilter(Filter%3CTemporal%3E filter) %7B%0A        this.filter = filter;%0A    %7D%0A    %0A    @Override%0A    protected Void doInBackground(Void... params ) %7B%0A        CloseableIterator%3CLocation%3E iterator = null;%0A        try %7B%0A            iterator = iterator();%0A%0A            int i = 0;%0A            while (iterator.hasNext()) %7B%0A                i++;%0A                publishProgress(iterator.next());%0A            %7D%0A            Log.i(%22location query%22, %22location query get all locations: %22 + i);%0A%0A        %7D catch (SQLException e) %7B%0A            e.printStackTrace();%0A        %7D finally %7B%0A            if (iterator != null) %7B%0A                iterator.closeQuietly();%0A            %7D%0A        %7D%0A%0A        return null;%0A    %7D%0A%0A    @Override%0A    protected void onProgressUpdate(Location... locations) %7B%0A        locationCollection.add(locations%5B0%5D);%0A    %7D%0A    %0A    private CloseableIterator%3CLocation%3E iterator() throws SQLException %7B%0A        Dao%3CLocation, Long%3E dao = DaoStore.getInstance(context).getLocationDao();%0A        QueryBuilder%3CLocation, Long%3E query = dao.queryBuilder();%0A        Where%3C? extends Temporal, Long%3E where = query%0A                .orderBy(%22last_modified%22, false)%0A                .where()%0A                .ge(%22last_modified%22, locationCollection.getLatestDate());   %0A%0A        if (filter != null) %7B%0A            where = filter.where(where.and());            %0A        %7D%0A                %0A        return dao.iterator(query.prepare());%0A    %7D%0A%7D

LocationLoad task