Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using local gis server
Qt 6.11 is out! See what's new in the release blog

Using local gis server

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mihaill
    wrote on last edited by
    #1

    Hi!
    I have local QGIS-server and this requests works on my PC:

    http://localhost:81/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
    http://localhost:81/cgi-bin/myProject/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
    

    How I can using this server?
    I try this in QML, but it's not work:

    PluginParameter { name: "osm.mapping.host"; value: "http://127.0.0.1:81/cgi-bin/myProject/" }
    PluginParameter { name: "osm.mapping.host"; value: "http://localhost:81/cgi-bin/myProject" }
    
    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by Chris Kawa
      #2

      QGIS appears to provide an OGC WMTS interface, not an OpenStreetMap interface (or any other supported by Qt out-of-the-box).
      You might find this GIS Stack Exchange article informative, but it does not provide a copy and paste solution.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mihaill
        wrote on last edited by
        #3

        I install OSM local server.
        On this url i can get tile:

        http://tile.your-domain.com/osm/5/5/6.png
        

        But how I can use this local osm server in QML Plagin?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mihaill
          wrote on last edited by Mihaill
          #4

          @Mihaill said in Using local gis server:

          http://tile.your-domain.com/osm/5/5/6.png

          it is work
          https://www.linuxbabe.com/ubuntu/openstreetmap-tile-server-ubuntu-20-04-osm
          https://kurazhov.ru/tile-server-openstreetmap/

              Plugin {
                  id: mapPlugin
                  name: "osm"
          
                  PluginParameter { name: "osm.mapping.providersrepository.disabled"; value: true }
                  PluginParameter { name: "osm.mapping.host"; value: "http://tile.your-domain.com/osm/" }
              }
          
          Q 1 Reply Last reply
          0
          • M Mihaill

            @Mihaill said in Using local gis server:

            http://tile.your-domain.com/osm/5/5/6.png

            it is work
            https://www.linuxbabe.com/ubuntu/openstreetmap-tile-server-ubuntu-20-04-osm
            https://kurazhov.ru/tile-server-openstreetmap/

                Plugin {
                    id: mapPlugin
                    name: "osm"
            
                    PluginParameter { name: "osm.mapping.providersrepository.disabled"; value: true }
                    PluginParameter { name: "osm.mapping.host"; value: "http://tile.your-domain.com/osm/" }
                }
            
            Q Offline
            Q Offline
            QuanTong
            wrote on last edited by QuanTong
            #5

            @Mihaill
            Hi Mihaill,

            I did as your recommend but could not load the map. Could you help me?

            I followed this url to setup the server: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-20-04-lts/

            I could access those tiles via browser with url domain is localhost or 127.0.0.1 or my IP.
            And the uri is "hot"
            E.x: http://localhost/hot/7/10/26.png

            This is my simple source code:

            Window {
                visible: true
            
                width: 800
                height: 600
            
                Plugin {
                    id: mapPlugin
                    name: "osm"
                    PluginParameter {
                        name: "osm.mapping.providersrepository.disabled"
                        value: true
                    }
                    PluginParameter {
                        name: "mymap"
                        value: "http://127.0.0.1/hot/"
                    }
                }
            
                Map {
                    id: map
                    anchors.fill: parent
                    center {
                        latitude: 10.802138
                        longitude: 106.6397577
                    }
                    zoomLevel: 10
                    gesture.enabled: true
                    plugin: mapPlugin
            
                    //Make sure to set activeMapType equal to MapType.CustomType
                    activeMapType: {
                        return MapType.CustomType
                    }
                }
            }
            

            I get warning when run: qrc:/main.qml:83:9: Unable to assign [undefined] to QDeclarativeGeoMapType*

            This point to MapType.CustomType :|

            Thank you!

            Q 1 Reply Last reply
            0
            • Q QuanTong

              @Mihaill
              Hi Mihaill,

              I did as your recommend but could not load the map. Could you help me?

              I followed this url to setup the server: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-20-04-lts/

              I could access those tiles via browser with url domain is localhost or 127.0.0.1 or my IP.
              And the uri is "hot"
              E.x: http://localhost/hot/7/10/26.png

              This is my simple source code:

              Window {
                  visible: true
              
                  width: 800
                  height: 600
              
                  Plugin {
                      id: mapPlugin
                      name: "osm"
                      PluginParameter {
                          name: "osm.mapping.providersrepository.disabled"
                          value: true
                      }
                      PluginParameter {
                          name: "mymap"
                          value: "http://127.0.0.1/hot/"
                      }
                  }
              
                  Map {
                      id: map
                      anchors.fill: parent
                      center {
                          latitude: 10.802138
                          longitude: 106.6397577
                      }
                      zoomLevel: 10
                      gesture.enabled: true
                      plugin: mapPlugin
              
                      //Make sure to set activeMapType equal to MapType.CustomType
                      activeMapType: {
                          return MapType.CustomType
                      }
                  }
              }
              

              I get warning when run: qrc:/main.qml:83:9: Unable to assign [undefined] to QDeclarativeGeoMapType*

              This point to MapType.CustomType :|

              Thank you!

              Q Offline
              Q Offline
              QuanTong
              wrote on last edited by QuanTong
              #6

              @QuanTong
              I fixed, maybe the MapType.CustomType is not passed as my old code above.
              I found a guy who fixed from this and I tried -> It worked well <3

              My new source code:

              Window {
                  visible: true
              
                  width: 800
                  height: 600
              
                  Plugin {
                      id: mapPlugin
                      name: "osm"
              
                      PluginParameter {
                          name: "osm.mapping.providersrepository.disabled"
                          value: true
                      }
                      PluginParameter {
                          name: "osm.mapping.custom.host" // Modified here
                          value: "http://127.0.0.1/hot/"
                      }
                  }
              
                  Map {
                      id: map
              
                      anchors.fill: parent
              
                      center {
                          latitude: 10.802138
                          longitude: 106.6397577
                      }
              
                      zoomLevel: 10
              
                      gesture.enabled: true
              
                      plugin: mapPlugin
              
                      //Make sure to set activeMapType equal to MapType.CustomType
                      activeMapType: {
                          return map.supportedMapTypes[6]  // Modified here
                      }
                  }
              }
              
              
              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved