Skip to content

Commit

Permalink
Merge pull request #1276 from Artsdatabanken/feilobjekt
Browse files Browse the repository at this point in the history
LA-KA (Kystås og kystfjell) viser helt feil polygoner i kartet.
  • Loading branch information
helemork authored Apr 9, 2019
2 parents b72d89d + ffa3659 commit 4bb6227
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/Kart/LeafletTangram/scene/visualisering/indexedRaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ function lagStyle(format, drawArgs) {
precision highp float;
highp float scaler = 1./512.;
highp float rgbaToIndex(vec4 rgba) {
return (rgba.g*128. + rgba.b/2.) - 0.5*scaler;
// g = x/256., b = x % 256
return (rgba.g*128. + rgba.b/2. + 0.5*scaler);
}`,
color: `
float v = rgbaToIndex(sampleRaster(0));
// v=rgbaToIndex(vec4(0.,1./256.,(292.-256.)/256.,0.));
vec4 fill1 = texture2D(palette1, vec2(v, depth));
vec4 fill2 = texture2D(palette2, vec2(v, depth));
vec4 fill = mix(fill1, fill2, clamp(u_time*2.5,0.,1.));
Expand All @@ -61,26 +61,7 @@ function lagStyle(format, drawArgs) {
};
return { name: "raster", value: gradient };
}
/*
color: `
float px = 1.;
vec3 off = vec3(-px, 0, px);
float v = rgbaToIndex(sampleRaster(0));
float diff = abs(v - rgbaToIndex(sampleRasterAtPixel(0, vec2(currentRasterPixel(0) + off.xy))));
diff += abs(v-rgbaToIndex(sampleRasterAtPixel(0, vec2(currentRasterPixel(0) + off.zy))));
diff += abs(v-rgbaToIndex(sampleRasterAtPixel(0, vec2(currentRasterPixel(0) + off.yx))));
diff += abs(v-rgbaToIndex(sampleRasterAtPixel(0, vec2(currentRasterPixel(0) + off.yz))));
diff = clamp(diff,0.,1.);
vec4 border = vec4(0.,0.,0.,0.8);
vec4 fill1 = texture2D(palette1, vec2(v/512., depth));
vec4 fill2 = texture2D(palette2, vec2(v/512., depth));
vec4 fill = mix(fill1, fill2, clamp(u_time*2.5,0.,1.));
float step = clamp((u_map_position.z-8.)*0.08,0.,1.);
color = mix(fill, border,diff*step);
//color = sampleRaster(0);
// color= vec4(1.,1.,0.,1.);
`
*/

function lagSource({ url, zoom }, { bbox }) {
const source = sysconfig.createTileSource(url, "Raster", zoom, bbox);
// source.tile_size = 256;
Expand Down

0 comments on commit 4bb6227

Please sign in to comment.