Code Monkey home page Code Monkey logo

Comments (14)

julienr avatar julienr commented on May 2, 2024 3

I managed to load a WMS as a custom basemap map style with a json file looking like this (this needs to be accessible through a URL which you then use as the "map style URL" in kepler).

{
  "version": 8,
  "name": "My raster",
  "sources": {
    "raster-source-1": {
      "type": "raster",
      "tiles": [
        "https://wms.zh.ch/OrthoZHWMS?Request=GetMap&layers=ortho_18&bbox={bbox-epsg-3857}&crs=EPSG:3857&format=image/png&width=256&height=256&version=1.3.0"
      ],
      "scheme": "tms"
    }
  },
  "layers": [
    {
      "id": "raster-layer-1",
      "type": "raster",
      "source": "raster-source-1"
    }
  ],
  "id": "my-raster"
}

This particular WMS only contains data over zurich switzerland. You can load the following GeoJSON in kepler (a square over Zurich) to test it:

{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[8.496551513671873,47.34696504890934],[8.573455810546875,47.34696504890934],[8.573455810546875,47.38858773975688],[8.496551513671873,47.38858773975688],[8.496551513671873,47.34696504890934]]]}}]}

from kepler.gl.

ziyili66 avatar ziyili66 commented on May 2, 2024

@magamonsta can you share an example using WMS/WMTS and also any documentation regarding this if applicable?

from kepler.gl.

magamonsta avatar magamonsta commented on May 2, 2024

@yiyaya66 not sure if you're familiar with leaflet, its an opensource javascript library that allows you to build customized maps and load in various basemaps and tilelayers, its a great tool but requires a fair amount of dev work to get it up and running, here is a link to their documentation for adding in a tilelayer and adding in a wms. in past projects i've been required to use certain base maps, similar to some of these that ESRI has available.

from kepler.gl.

wmhafiz avatar wmhafiz commented on May 2, 2024

any luck on having custom wms/wmts support so far? our company maintain our own basemap service and thats the only issue preventing us from using this amazing library

from kepler.gl.

ibgreen avatar ibgreen commented on May 2, 2024

@wmhafiz It does not look too hard to add support for this, and I agree that this would be a valuable addition to kepler.gl / deck.gl / loaders.gl. If someone contributed a solid implementation, it would almost certainly be accepted!

At the same time, keep in mind that the kepler.gl open source team is essentially working for free, and it may be hard for them to justify adding support for a backend system they are not using themselves.

However, if this is really critical to your use case, feel free to contact me directly to discuss options (e.g. on the kepler.gl slack channel or via my github profile).

from kepler.gl.

wmhafiz avatar wmhafiz commented on May 2, 2024

Thats great! I would be interested to have a go at it, if u can help point me in the right direction. I will have to find some time to read through the source code first though.

What's your username on slack? i just joined the slack channel and hope to talk to you soon!

from kepler.gl.

ibgreen avatar ibgreen commented on May 2, 2024

@wmhafiz I found you on kepler.gl slack and messaged you - I will summarize in repo later if we make progress.

from kepler.gl.

dguceleste avatar dguceleste commented on May 2, 2024

Hi guys. Any news about this?

from kepler.gl.

ibgreen avatar ibgreen commented on May 2, 2024

Unfortunately we failed to connect, so no progress was made.

from kepler.gl.

kylebarron avatar kylebarron commented on May 2, 2024

This issue's title could be improved, because here the question is specifically about loading tiles in a non-XYZ tile index. You can already load non-Mapbox imagery tile layers by referencing them in a style.json file, see #406 (comment).

This issue is more geared towards supporting the WMS/WMTS indexing/tile request systems. I don't know enough about them to comment.

from kepler.gl.

macrigiuseppe avatar macrigiuseppe commented on May 2, 2024

please have a look at this one: #1440

from kepler.gl.

runsalot87 avatar runsalot87 commented on May 2, 2024

I managed to load a WMS as a custom basemap map style with a json file looking like this (this needs to be accessible through a URL which you then use as the "map style URL" in kepler).

{
  "version": 8,
  "name": "My raster",
  "sources": {
    "raster-source-1": {
      "type": "raster",
      "tiles": [
        "https://wms.zh.ch/OrthoZHWMS?Request=GetMap&layers=ortho_18&bbox={bbox-epsg-3857}&crs=EPSG:3857&format=image/png&width=256&height=256&version=1.3.0"
      ],
      "scheme": "tms"
    }
  },
  "layers": [
    {
      "id": "raster-layer-1",
      "type": "raster",
      "source": "raster-source-1"
    }
  ],
  "id": "my-raster"
}

This particular WMS only contains data over zurich switzerland. You can load the following GeoJSON in kepler (a square over Zurich) to test it:

{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[8.496551513671873,47.34696504890934],[8.573455810546875,47.34696504890934],[8.573455810546875,47.38858773975688],[8.496551513671873,47.38858773975688],[8.496551513671873,47.34696504890934]]]}}]}

@julienr - does this method still work? I cannot seem to get this to work (probably user error on my part). Could you perhaps share with me how you did this? Also, have you had any luck with with a XYZ tiler server? Thanks in advance!

from kepler.gl.

julienr avatar julienr commented on May 2, 2024

@runsalot87 I haven't used kepler recently, so I'm not sure if this is still working. Never tried it on XYZ server.

from kepler.gl.

osterm38 avatar osterm38 commented on May 2, 2024

@runsalot87 : With slight modification, @julienr 's style works (python 3.9.10, jupyterlab 3.3.4, keplergl 0.3.2). I got the following style.json working, though this (and a few adjacent in my repo) mostly serves as an example for when I find a better WMS (non-xyz) basemap to load into kepler:

{
    "version": 8,
    "id": "my-raster",
    "name": "My raster",
    "zoom": 1,
    "pitch": 0,
    "bearing": 0,
    "center": [
      0,
      0
    ],
    "layers": [
        {
          "id": "raster-layer-1",
          "type": "raster",
          "source": "raster-source-1",
          "paint": {}
        }
      ],
      "sources": {
      "raster-source-1": {
        "type": "raster",
        "tiles": [
          "https://wms.zh.ch/OrthoZHWMS?Request=GetMap&layers=ortho_s_18&bbox={bbox-epsg-3857}&crs=EPSG:3857&format=image/png&width=256&height=256&version=1.3.0"
        ],
        "tileSize": 256
      }
    }
  }

from kepler.gl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.