Update vtm-jeo module, closes #52

This commit is contained in:
Emux
2016-07-07 14:05:15 +03:00
parent 51f3e2368b
commit c02cf5792f
9 changed files with 140 additions and 28 deletions

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.layers;
import static org.oscim.tiling.QueryResult.FAILED;
@@ -7,7 +23,7 @@ import static org.oscim.tiling.QueryResult.TILE_NOT_FOUND;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.jeo.data.TileDataset;
import org.jeo.tile.TileDataset;
import org.jeo.tile.Tile;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.canvas.Bitmap;
@@ -24,7 +40,7 @@ public class JeoTileSource extends TileSource {
final TileDataset mTileDataset;
public JeoTileSource(TileDataset tileDataset) {
log.debug("load tileset {}", tileDataset.getName());
log.debug("load tileset {}", tileDataset.name());
mTileDataset = tileDataset;
//mTileDataset.pyramid().
mZoomMax = 1;
@@ -47,7 +63,7 @@ public class JeoTileSource extends TileSource {
sink.completed(TILE_NOT_FOUND);
return;
}
Bitmap b = CanvasAdapter.decodeBitmap(new ByteArrayInputStream(t.getData()));
Bitmap b = CanvasAdapter.decodeBitmap(new ByteArrayInputStream(t.data()));
sink.setTileImage(b);
log.debug("success {}", tile);
sink.completed(SUCCESS);

View File

@@ -1,10 +1,26 @@
/*
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.layers;
import java.io.IOException;
import org.jeo.data.Query;
import org.jeo.data.VectorDataset;
import org.jeo.feature.Feature;
import org.jeo.vector.VectorQuery;
import org.jeo.vector.VectorDataset;
import org.jeo.vector.Feature;
import org.jeo.geom.Geom;
import org.jeo.map.CartoCSS;
import org.jeo.map.RGB;
@@ -40,7 +56,7 @@ public class JeoVectorLayer extends JtsLayer {
super(map);
mDataset = data;
mRules = style.getRules().selectById(data.getName(), true).flatten();
mRules = style.getRules().selectById(data.name(), true).flatten();
//mRules = style.getRules().selectById("way", true).flatten();
log.debug(mRules.toString());
@@ -58,7 +74,7 @@ public class JeoVectorLayer extends JtsLayer {
}
try {
Query q = new Query().bounds(b);
VectorQuery q = new VectorQuery().bounds(b);
if (dbg)
log.debug("query {}", b);
for (Feature f : mDataset.cursor(q)) {
@@ -104,7 +120,7 @@ public class JeoVectorLayer extends JtsLayer {
}
}
} catch (IOException e) {
log.error("Error querying layer " + mDataset.getName() + e);
log.error("Error querying layer " + mDataset.name() + e);
}
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.layers;
import org.jeo.geom.CoordinatePath;
@@ -43,7 +59,7 @@ public abstract class JtsLayer extends AbstractVectorLayer<Geometry> {
float x = (float) ((MercatorProjection.longitudeToX(c.x) - pos.x) * scale);
float y = (float) ((MercatorProjection.latitudeToY(c.y) - pos.y) * scale);
switch (path.getStep()) {
switch (path.step()) {
case MOVE_TO:
if (g.isPoly())
g.startPolygon();

View File

@@ -1,9 +1,25 @@
/*
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.layers;
import java.util.HashMap;
import org.jeo.data.VectorDataset;
import org.jeo.feature.Feature;
import org.jeo.vector.VectorDataset;
import org.jeo.vector.Feature;
import org.jeo.map.CartoCSS;
import org.jeo.map.RGB;
import org.jeo.map.Rule;