OSGeo Planet

Nathan Woodrow: Speeding up QGIS build times with Ninja

OSGeo Planet - 8 hours 57 min ago

As a developer, feedback is important when you are working.  The quicker you have the feedback the quicker you can fix the issues.  This doesn’t just apply to feedback from users/clients but also from your tooling.

Finding a new tool that increases my productivity is one of the best feelings, and this is one of those cases.   I was told about using Ninja for building instead Make, Visual Studio, Jom (Qt Build Tool).

If you are not a developer and don’t know what those tools are, they are what we use to build and compile all the code in QGIS.  If this step is slow the feedback loop is slow and it becomes annoying.  Improving this feedback loop greatly increases your workflow and happiness, and by happiness I really do mean that.

Ninja is one of these tools that did this. It’s optimized to be fast.  It does very little work in order to be faster any time it can.  Ninja was built by a developer on the Google Chrome team in order to improve their build times (read the history here)

Building QGIS with Ninja is super easy:

Install Ninja from package manager or using the ninja.exe (the whole tool is a single exe) if you are on windows

cd qgis-src mkdir ninja-build cd ninja-build ccmake -GNinja .. ninja

Done

You can build just the targets you need using

ninja qgis ninja pycore

etc

The ccmake setup generates the ninja.build file that ninja uses. Myself and Matthias Kuhn have already patched our QGIS cmake files to handle any odd things that got generated – only a handful of things which was nice

The best thing I find about Ninja is how smart it is on knowing if it needs to build something or not, and this is the point that I find other tools fail on. They spend ages wasting time looking for what to do. Ninja knows it in a instant.

When running Ninja with no code changes I get this (on Windows):

21:18:54: Running steps for project qgis2.15.0... 21:18:54: Starting: "C:\QtCreator\bin\ninja.exe" qgis ninja: no work to do. 21:18:54: The process "C:\QtCreator\bin\ninja.exe" exited normally. 21:18:54: Elapsed time: 00:00.

Not even a second. If I did the same with VS or JOM I could have written this post before it finished working out what to do.

Here is what happens changing a single file:

21:19:48: Running steps for project qgis2.15.0... 21:19:48: Starting: "C:\QtCreator\bin\ninja.exe" qgis [1/6] Building CXX object src\core\CMakeFiles\qgis_core.dir\raster\qgshillshaderenderer.cpp.obj [2/6] Linking CXX shared library output\bin\qgis_core.dll 21:19:51: The process "C:\QtCreator\bin\ninja.exe" exited normally. 21:19:51: Elapsed time: 00:03.

It’s super impressive. Even a cold build on Windows is shorter now. On Linux it’s even faster due to faster disk access in Linux vs Windows

If you build QGIS form source I would highly recommend giving it a crack because I know you will love it.


Filed under: Open Source, qgis
Categories: OSGeo Planet

gvSIG Team: gvSIG Festival: Third Day [Videos]

OSGeo Planet - Wed, 2016-05-25 16:52

Scripting in gvSIG (English) [Óscar Martínez. gvSIG Association]

gvSIG Roads: gestión de la conservación e inventario de carreteras con software libre (Spanish) [Ricardo Rueda.DiSiD. gvSIG Association]

GIS tools for water supply systems: an implementation using Epanet and gvSIG (English) [Silvia Franceschi. HydroloGIS. gvSIG Association]

gvSIG Online: IDE para la Secretaría de Turismo de México (Spanish) [Juan José del Toro. GeoAlternativa]

Delimitación de Microcuencas hidrográficas con gvSIG (Spanish) [Roxana Sánchez. (Parque Tecnológico Itaipú-Paraguay)]

Sistema de Información Geografico Para Catrastro Municipal con Software Libre (Spanish) [Marino Carhuapoma. IdeasG]

And tomorrow…

11:00-12:00

Evaluating temporal changes to water bodies in Medak India (English) [Gowtham Gollapalli.KAIINOS]

12:00-13:00

New tools for LiDAR, forestry, river management and hydro-geomorphology with jGrassTools in gvSIG (English) [Andrea Antonello and Silvia Franceschi. HydroloGIS. gvSIG Association]

13:00-14:00

Introduction to gvSIG (Turkish) [Yalçin. Univ.Estambul]

16:00-17:00

Geoprocesamiento con gvSIG (Spanish) [Gustavo Agüero. Consultores AA]

17:00-18:00

Novedades gvSIG 2.3: ¿En qué estamos trabajando? (Spanish) [Alvaro Anguix. Asociación gvSIG]

18:00-19:00

Programa de Caminería Rural en Uruguay con gvSIG (Spanish) [Sergio Acosta.MTOP]


Filed under: english, events, gvSIG Desktop, spanish, Turkish Tagged: webinars
Categories: OSGeo Planet

Jackie Ng: MapGuide Open Source 3.1 pre-flight check part 3 (a wild roadblock appeared!)

OSGeo Planet - Wed, 2016-05-25 15:16
Stop the presses. We ran into a blocker!

A particular nasty one, that affects not just MapGuide on CentOS, but on Ubuntu as well.

Something slipped into MapGuide or the WMS FDO provider that causes mgserver to segfault when one does a GETFEATUREPROVIDERS request and a WFS/WMS FDO connection is created when inspecting its capabilities. Previously, I thought it was a quirk with the internal FDO source copy of OpenSSL and so FDO was built using the system-installed copy of OpenSSL (like we did for Ubuntu), but this problem still persisted on CentOS, and it turned out it was also segfaulting on Ubuntu as well!

Running this under gdb didn't help us at all. It only shows that the SIGSEGV happens at a function named ?? in libWMSProvider.so on CentOS, and at a function named _init in libWMSProvider.so on Ubuntu. Not very helpful.

Even the venerable valgrind couldn't help me here. Putting mgserver under valgrind and triggering the segfault gives me this incomprehensible gibberish

==11521== Thread 13:
==11521== Jump to the invalid address stated on the next line
==11521==    at 0x6E8A6: ???
==11521==    by 0x4275D9F: FdoConnectionManager::CreateConnection(wchar_t const*) (ConnectionManager.cpp:334)
==11521==    by 0x4BBB543: MgServerGetFeatureProviders::AddConnectionProperties(xercesc_3_1::DOMElement*, wchar_t const*) (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BBADD3: MgServerGetFeatureProviders::CreateFeatureProvidersDocument() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BB9E23: MgServerGetFeatureProviders::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B67285: MgServerFeatureService::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B303A4: MgOpGetFeatureProviders::Execute() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B19AE6: MgFeatureServiceHandler::ProcessOperation() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x809768A: MgOperationThread::ProcessOperation(MgServerStreamData*) (OperationThread.cpp:397)
==11521==    by 0x8095C1B: MgOperationThread::ProcessMessage(ACE_Message_Block*) (OperationThread.cpp:226)
==11521==    by 0x8094536: MgOperationThread::svc() (OperationThread.cpp:90)
==11521==    by 0x623521B: ACE_Task_Base::svc_run(void*) (in /usr/local/mapguideopensource-3.1.0/lib/libACE.so)
==11521==  Address 0x6e8a6 is not stack'd, malloc'd or (recently) free'd
==11521== 
==11521== 
==11521== Process terminating with default action of signal 11 (SIGSEGV)
==11521==  Bad permissions for mapped region at address 0x6E8A6
==11521==    at 0x6E8A6: ???
==11521==    by 0x4275D9F: FdoConnectionManager::CreateConnection(wchar_t const*) (ConnectionManager.cpp:334)
==11521==    by 0x4BBB543: MgServerGetFeatureProviders::AddConnectionProperties(xercesc_3_1::DOMElement*, wchar_t const*) (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BBADD3: MgServerGetFeatureProviders::CreateFeatureProvidersDocument() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4BB9E23: MgServerGetFeatureProviders::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B67285: MgServerFeatureService::GetFeatureProviders() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B303A4: MgOpGetFeatureProviders::Execute() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x4B19AE6: MgFeatureServiceHandler::ProcessOperation() (in /usr/local/mapguideopensource-3.1.0/server/lib/libMgServerFeatureService-3.1.0.so)
==11521==    by 0x809768A: MgOperationThread::ProcessOperation(MgServerStreamData*) (OperationThread.cpp:397)
==11521==    by 0x8095C1B: MgOperationThread::ProcessMessage(ACE_Message_Block*) (OperationThread.cpp:226)
==11521==    by 0x8094536: MgOperationThread::svc() (OperationThread.cpp:90)

==11521==    by 0x623521B: ACE_Task_Base::svc_run(void*) (in /usr/local/mapguideopensource-3.1.0/lib/libACE.so)

I admit to not being an expert-level C++ developer, so when I can't find the usual cases for a SIGSEGV (eg. A null pointer de-reference) in gdb/valgrind output, I am often left scratching my head. Google searches on these error messages weren't of much help.

The good thing was that this problem only happens on FDO since 4.0 was branched and released (we're targeting FDO 4.1 here) so in the absence of expert-level C++ knowledge it was time to be systematic and track down the offending FDO revision since 4.0 branched that introduced this breakage. Time to apply that binary search again! After several wasted days of trial and error compilation/testing, we found the offending revision.

At face value, this commit looks innocuous enough, a few new files and some modifications. Nothing in the new and modified files that sounds like dangerous C++ code to my padawan-tier knowledge.


But looking at the overall list of files, something caught my eye. In this commit was a project file update, but it was only for windows (the modified WMSProvider.vcxproj file). Normally if new files are to be added, not only should the windows vcxproj file be updated as well (to include the new .h and .cpp files), but the corresponding Makefile.am files for Linux as well, and this was conspicuously absent.

This lit a light-bulb in my head, I had a look at the Makefile.am file for the WMS provider and lo-and-behold, it didn't have the new .cpp and .h files in this commit. Then it all came together.

The WMS provider was segfaulting because it was being compiled with undefined symbols (to the new FdoWmsGetFeatureInfoFormats class). Updating the Makefile.am with the missing files and re-compiling the WMS provider made the segfault go away.

And that was the tale of how I cleared the final roadblock to releasing MapGuide Open Source 3.1 (smoke tests with this change all pass, the beta 1 binaries are being built as this blog post is being published). Now on Windows with the MSVC compiler, such a problem would've manifested at the compiler phase as LNK2001 unresolved external symbol errors, so it surprised me big time that gcc or ld did not error out about undefined symbols and immediately break the build which would've caught this problem much sooner!

It turns out gcc/ld erroring out is a flag you have to opt-in to. The more you know. Thanks to Johan for the heads up.

So you can now expect the next post to be about ...
Categories: OSGeo Planet

Tim Waters: Mapwarper featured in A Digital Humanities Primer for English Students

OSGeo Planet - Wed, 2016-05-25 13:02

Jenna Herdman has written an excellent free e-book about Digital Humanities for English Students which has an entire chapter titled: Digital Mapping Tool Tutorial which features the Mapwarper. It’s been published using gitbook and is available in pdf, html, epub formats.

The tutorial covers adding a map to mapwarper.net to chart the movements of David in Charles Dickens’s David Copperfield.

unspecified-2

The map is then loaded into Palladio which is a new tool for me. it “is a web-based platform for the visualization of complex, multi-dimensional data”.

unspecified-1

Do check out this great resource. The book has seven chapters in total and all of them are interesting and worthwhile to read! https://www.gitbook.com/book/jennaherdman/a-digital-humanities-primer-for-english-students/details


Categories: OSGeo Planet

Paul Ramsey: Drowning in Passwords

OSGeo Planet - Wed, 2016-05-25 11:00

I like the internet, I use a lot of sites, I don’t fear online shopping or discussion or communication or banking. As a result, I have a pretty healthy footprint of accounts, and I have been finding recently that my brain can no longer keep up.

Drowning in Passwords

So I’ve started using a password manager, LastPass, which works just fine.

Once I fully committed to it, the number of passwords managed started a slow and seemingly relentless climb, as over time I returned to all the many sites at which I had been forced to register accounts in the past. As a result, I’ve learned useful things:

  • The number of sites I have accounts on is far larger than I thought. I have 40 entries in LastPass already, and I imagine I’m only about 2/3 of the way through adding all the sites I use more than once a year. Of those, easily a dozen are what you might call “important”: banks, brokerages, email, OAuth sources (Twitter, Facebook, Google), etc. Far more sites than I kept separate passwords for!
  • The centrality and potential vulnerability of the email account is hard to overstate. For 90% of the accounts I have added, the first step was “reset the password”, since I had forgotten it. (In fact, that was my old access mechanism, since I accessed many sites so rarely.) And “reset” uses access to email as a source of proxy authentication. So, 0wn my email address, 0wn me, entirely. If you haven’t enabled two-factor authentication on your email account yet, you need to, because of this.

Usually, improving security involves things getting more inconvenient but in the case of using a password manager, it has actually been a net improvement. No more time spent trying to remember which of the passwords in my limited brain key-chain I had used for a site. No more reset-password-and-wait for the many sites at which I had no idea what the password was.

LastPass has been very good, and I have only one note/caveat. The password manager works by installing a plug-in into your browser, so if you use multiple browsers (I use both Chrome and Safari regularly) you’ll end up with multiple plugins. The preferences on those plugins are managed separately. Same thing if you use multiple computers (I do, desktop and laptop). Each plugin on each computer has separate preferences.

This is important because the LastPass preferences are, in my opinion, a little loose. Once you provide the master password, by default, the password vault remains unlocked and available until you actually shut down your browser. I can go days without shutting down my browser. So, I changed that preference to a time-out of 15 minutes instead. But I had to change it on every browser and on every computer I owned, which was not intuitive, since the plugin is good about sharing other information to other installs transparently (add a password on one browser, it’s available on all).

So far I’ve been using the free version of LastPass, but as I move into the mobile world I will probably have to buck up for the paid version for support on mobile devices. Given how much it has simplified my life, I won’t begrudge them the dollars.

Bonus paragraph: Isn’t saving all my passwords on a cloud service really dumb? Not so much. The passwords are only ever decrypted locally by the password manager plugin. The cloud just stores a big encrypted lump of passwords, and I have a lot of faith in AES256. However, my security now has one big central point of failure: the master password. But since I only have to remember one master password, I have been able to make it nice and long, so any remote technical attack on my security is unlikely. That just leaves all the other kinds of attack (social engineering, keylogging, device theft, human factors, etc, etc).

Categories: OSGeo Planet

Fernando Quadro: Introdução ao OpenLayers 3: Controles

OSGeo Planet - Wed, 2016-05-25 10:08

Uma ferramenta típica para exibir em seu mapa é a barra de escala, e o OpenLayers 3 fornece a classe ol.control.ScaleLine para esta finalidade.

Vamos adicionar a escala no nosso mapa, para isso abra o arquivo map.html em seu editor de texto, e adicione o seguinte código para criar este novo controle em seu mapa:

controls: ol.control.defaults().extend([
  new ol.control.ScaleLine()
]),

Veja como ficou:

scaleline1

Você pode encontrar dificuldades para ler as informações sobre a barra de escala. Existem algumas atitudes que podem ser tomadas a fim de melhorar a visibilidade da escala. Se você quiser manter o controle dentro do mapa de exibição, você pode adicionar algumas declarações de estilo dentro do CSS do seu documento.

Para testar isso, você pode incluir uma cor de fundo e preenchimento para a barra de escala com algo parecido com o seguinte:

.ol-scale-line, .ol-scale-line:not([ie8andbelow]) {
   background: black;
   padding: 5px;
 }

No entanto, digamos que você acha que o mapa está ficando poluído visualmente. Para evitar isso, você pode exibir a escala em um local diferente. Para isso, precisamos primeiro criar um elemento adicional na nossa página e, em seguida, dizer ao controle de escala para criar-se dentro deste novo elemento.

Vamos então criar um novo elemento no <body> da sua página HTML. Para que seja fácil de referenciar este elemento, vamos dar-lhe um ID. Insira o seguinte código em algum lugar do <body> do seu map.html. (Colocar o elemento escala logo após o elemento do mapa <div id = “map”> </ div> faz sentido.):

<div id="scale-line" class="scale-line"></div>

Agora altere o código do controle de escala para fazer referência ao novo elemento:

controls: ol.control.defaults().extend([
  new ol.control.ScaleLine({className: 'ol-scale-line', target: document.getElementById('scale-line')})
]),

Adicione o código abaixo no seu estilo CSS:

.scale-line {
  position: absolute;
  top: 350px;
}
.ol-scale-line {
  position: relative;
  bottom: 0px;
  left: 0px;
}

Salve as alterações e abra o arquivo map.html no seu browser: @servidor@/map.html

scaleline2

Como vimos no post Vetores, podemos utilizá-los sobre um mapa base. Uma das vantagens de utilizarmos vetores é que podemos interagir com os dados. Neste exemplo, criamos uma camada de vetor, onde os usuários podem selecionar e visualizar as informações.

O exemplo anterior demonstrou a utilização de controles no mapa. A classe ol.interaction.Interaction é um controle responsável por manipular a interação do usuário, mas normalmente não tem uma representação visual. O exemplo abaixo demonstra o uso da classe ol.interaction.Select para interagir com uma camada vetorial. Veja:

<!doctype html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="ol3/ol.css" type="text/css">
    <style>
    #map {
      height: 256px;
      width: 512px;
    }
    </style>
    <script src="ol3/ol.js" type="text/javascript"></script>
    <title>OpenLayers 3 example</title>
  </head>
  <body>
    <h1>My Map</h1>
    <div id="map"></div>
    <script type="text/javascript">
      var map = new ol.Map({
        interactions: ol.interaction.defaults().extend([
          new ol.interaction.Select({
            style: new ol.style.Style({
              image: new ol.style.Circle({
                radius: 5,
                fill: new ol.style.Fill({
                  color: '#FF0000'
                }),
                stroke: new ol.style.Stroke({
                  color: '#000000'
                })
              })
            })
          })
        ]),
        target: 'map',
        layers: [
          new ol.layer.Tile({
            title: "Global Imagery",
            source: new ol.source.TileWMS({
              url: 'http://maps.opengeo.org/geowebcache/service/wms',
              params: {LAYERS: 'bluemarble', VERSION: '1.1.1'}
            })
          }),
          new ol.layer.Vector({
            title: 'Earthquakes',
            source: new ol.source.GeoJSON({
              url: 'data/layers/7day-M2.5.json'
            }),
            style: new ol.style.Style({
              image: new ol.style.Circle({
                radius: 5,
                fill: new ol.style.Fill({
                  color: '#0000FF'
                }),
                stroke: new ol.style.Stroke({
                  color: '#000000'
                })
              })
            })
          })
        ],
        view: new ol.View({
          projection: 'EPSG:4326',
          center: [0, 0],
          zoom: 1
        })
      });
    </script>
  </body>
</html>

Salve as alterações, e para ver o recurso de seleção em ação, use o clique do mouse para selecionar um elemento:

select1

Posts RelacionadosZemanta
Categories: OSGeo Planet

gvSIG Team: gvSIG Festival: Second Day [Videos]

OSGeo Planet - Wed, 2016-05-25 07:51

gvSIG Online: the solution for Spatial Data Infrastructures on Open Source software (English) [César Martínez. Scolab. gvSIG Association]


Digital field mapping with Geopaparazzi and gvSIG (English) [Andrea Antonello. HydroloGIS. gvSIG Association]

Utilización del software gvSIG para el análisis acústico urbano: Sistema de Autopistas de La Ciudad Autónoma de Buenos Aires (Spanish) [Mario Fèvre. Trecc]


gvSIG Online: la solución para Infraestructuras de Datos Espaciales con software libre (Spanish) [César Martínez. Scolab. Asociación gvSIG][La parte final no se grabó por problemas técnicos/The end of the webinar wasn’t recorded because of technical problems]


Введение в gvSIG (Russian) [Alexander Karandeev]

And Today…

11:00-12:00

Scripting in gvSIG (English) [Óscar Martínez. gvSIG Association]

12:00-13:00

gvSIG Roads: gestión de la conservación e inventario de carreteras con software libre (Spanish) [Ricardo Rueda.DiSiD. gvSIG Association]

13:00-14:00

GIS tools for water supply systems: an implementation using Epanet and gvSIG (English) [Silvia Franceschi. HydroloGIS. gvSIG Association]

16:00-17:00

gvSIG Online: IDE para la Secretaría de Turismo de México (Spanish) [Juan José del Toro. GeoAlternativa]

17:00-18:00

Delimitación de Microcuencas hidrográficas con gvSIG (Spanish) [Roxana Sánchez. (Parque Tecnológico Itaipú-Paraguay)]

18:00-19:00

Sistema de Información Geografico Para Catrastro Municipal con Software Libre (Spanish) [Marino Carhuapoma. IdeasG]

* Madrid Time. Click on the time of every webinar to check it in your city.

** Registration is available clicking on the title of every webinar.


Filed under: english, gvSIG Desktop, gvSIG Online, gvSIG Roads, Russian, spanish Tagged: webinars
Categories: OSGeo Planet

Paul Ramsey: Intellectual Capital vs Intellectual Property

OSGeo Planet - Tue, 2016-05-24 11:00

Building enterprise IT projects as “capital investments” is something I consider potentially dangerous, because it lumps IT “assets” along with much more durable and valuable physical assets.

A key question to ask of an “IT asset” is just how valuable and permanent the asset is. In the venture capital world, nothing makes investors happier than hearing that a company is spending their investment dollars creating “intellectual property”. This is an intellectual product that is defensible and ownable: it’s not locked up between some employee’s ears, it’s owned by the company.

In contrast, building “intellectual capital” is a much more risky proposition. Intellectual capital is my stock in trade, it’s what distinguishes me from a random C/C++ programmer: I know some very detailed things about some specific open source projects that would take quite a long time to learn from scratch. It’s valuable capital, but it lives between my ears. It’s mine and mine alone.

Intellectual Capital vs Intellectual Property

Why is this important for enterprise IT projects? Because so much of the value created in IT projects is “intellectual capital”. Staff are assembled by a consultancy and take months and years to learn a business domain and the particular tools for the problem, and the particular code base that is the system itself.

And then when the project is done… they are sent off to consultancy’s the next project. Flush…

Treating enterprise IT projects as capital projects encourages miscategorization all over the place:

  • The “system” is perceived as the target of the investment. But the value of the pile of code and hardware rapidly diminishes to zero once the knowledgeable staff are removed. Changes and enhancements that would take the original developers minutes now require days and weeks of staff learning time before they can be attempted.
  • The nature of the funding assumes that at some point the system will be “complete”. It will be in “maintenance” mode. Except the budget assigned to maintainance is too low to make any substantial changes in response to unexpected future needs. So when serious new requirements arise, the response is always to start again from scratch. With a new team.

It’s weird that IT projects get this special treatment, because other areas of government are perfectly aware that when staff leave, they carry out the accumulated intellectual capital of years of learning.

The very nature of the outsourced IT relationship has obscured the fact that government is routinely building up very expensive stores of intellectual capital and then sending them on their way only a handful of months or years after they’ve built them.

Maybe it’s time to get back to building systems in house?

Categories: OSGeo Planet

Fernando Quadro: Introdução ao OpenLayers 3: Vetores

OSGeo Planet - Tue, 2016-05-24 10:45

Camadas vetoriais no OL3 são representadas pela classe ol.layer.Vector que manipula a exibição de dados vetoriais no lado do cliente. Atualmente OpenLayers 3 só suporta renderização vetorial através do renderizador do Canvas.

Vamos voltar ao exemplo WMS para obter um mapa básico do mundo, para isso vamos adicionar alguns recursos em uma camada vetorial.

<!doctype html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="ol3/ol.css" type="text/css">
    <style>
      #map {
        height: 256px;
        width: 512px;
      }
    </style>
    <title>OpenLayers 3 example</title>
    <script src="ol3/ol.js" type="text/javascript"></script>
  </head>
  <body>
    <h1>My Map</h1>
    <div id="map"></div>
    <script type="text/javascript">
      var map = new ol.Map({
        target: 'map',
        layers: [
          new ol.layer.Tile({
            title: "Global Imagery",
            source: new ol.source.TileWMS({
              url: 'http://maps.opengeo.org/geowebcache/service/wms',
              params: {LAYERS: 'bluemarble', VERSION: '1.1.1'}
            })
          })
        ],
        view: new ol.View({
          projection: 'EPSG:4326',
          center: [0, 0],
          zoom: 0,
          maxResolution: 0.703125
        })
      });
    </script>
  </body>
</html>

Agora abra o arquivo map.html em seu editor de texto e copie o conteúdo do exemplo WMS inicial. Salve suas alterações, confirme e veja como ficou no seu navegador: @servidor@/map.html

No seu código de inicialização do mapa adicione outra camada após camada existente (código abaixo). Isso irá adicionar uma nova camada de vetorial para o seu mapa, para este exemplo você precisará de um arquivo GeoJSON que você pode criar no QGIS, por exemplo:

new ol.layer.Vector({
  title: 'Earthquakes',
  source: new ol.source.GeoJSON({
    url: 'data/layers/7day-M2.5.json'
  }),
  style: new ol.style.Style({
    image: new ol.style.Circle({
      radius: 3,
      fill: new ol.style.Fill({color: 'white'})
    })
  })
})

Veja como ficou o nosso mapa:

vector1

Como os dados contidos no arquivo GeoJSON estão em WGS84 (EPSG:4326) e a nossa camada base também, não é necessário uma reprojeção. No caso em que a projeção das camadas for diferente, isso significa que você deve especificar a projeção que deve ser utilizadas no seu mapa.

Posts RelacionadosZemanta
Categories: OSGeo Planet

gvSIG Team: GIS of Thrones: Mapping Game of Thrones with gvSIG

OSGeo Planet - Tue, 2016-05-24 10:39

Sometimes when we are doing training tasks, users ask us about free datasets to practice and learn all the possibilities that gvSIG gives us. Fortunately there are a great quantity of free data today, but it’s true that only a few times we find geographic information that allows us to enjoy while we learn to create legends, labeling, making geoprocesses…

We were thinking in it when we found a dataset, with free license, based on the successful series (in books and on TV) Game of Thrones. After testing it with gvSIG we found several errors at the information layers, but they were able to be solved easily with some geoprocesses. Since we were at that point, why don’t we play with symbology and labeling by scale?

Here you have a short video with the results:

And here you have a zip file with the data and the gvSIG project to be used. We know what project we are going to use to test the next version…

downloads.gvsig.org/download/documents/books/GISofThrones.zip

And another day we will speak about Star Wars…


Filed under: gvSIG Desktop
Categories: OSGeo Planet

gvSIG Team: gvSIG Festival: First Day [Videos]

OSGeo Planet - Mon, 2016-05-23 19:14

 Introduction to gvSIG (English) [Mario Carrera. gvSIG Association]

Utilización de gvSIG en estudios sobre desastres naturales y salud mental (Spanish) [Manuel Esteban Lucas Borja. Universidad de Castilla-La Mancha]

Utilização do gvSIG na Defesa Civil (Portuguese) [Gilberto Cugler. Comunidade gvSIG Brasil]

gvSIG applications in East Africa – Kenya and Somaliland (English) [Giuliano Ramat y Maurizio Fòdera]

O Futuro no Passado: o uso das geotecnologias aplicadas às pesquisas históricas (Portuguese) (Maíra Rosin. HIMACO]

And tomorrow…

11:00-12:00

gvSIG Online: the solution for Spatial Data Infrastructures on Open Source software (English) [César Martínez. Scolab. gvSIG Association]

12:00-13:00

Digital field mapping with Geopaparazzi and gvSIG (English) [Andrea Antonello. HydroloGIS. gvSIG Association]

13:00-14:00

gvSIG, un Système d’Information Géographique libre (French) [Victoria Agazzi. gvSIG Association]

16:00-17:00

Utilización del software gvSIG para el análisis acústico urbano: Sistema de Autopistas de La Ciudad Autónoma de Buenos Aires (Spanish) [Mario Fèvre. Trecc]

17:00-18:00

gvSIG Online: la solución para Infraestructuras de Datos Espaciales con software libre (Spanish) [José Vicente Higón. Scolab. Asociación gvSIG]

18:00-19:00

Delimitación de Microcuencas hidrográficas con gvSIG (Spanish) [Roxana Sánchez. (Parque Tecnológico Itaipú-Paraguay)]

19:00-20:00

Введение в gvSIG (Russian) [Alexander Karandeev]

* Madrid Time. Click on the time of every webinar to check it in your city.

** Registration is available clicking on the title of every webinar.


Filed under: english, events, portuguese, Russian, spanish Tagged: webinars
Categories: OSGeo Planet

GeoSolutions: MapStore 2: working hard on the new L&F

OSGeo Planet - Mon, 2016-05-23 17:35

MapStore 2 HomePage

Dear All, we just wanted to share with you the work that we are doing on the new Look&Feel for MapStore 2 with our partner Chef Studio

For MapStore 2 as we rewriting from scratch the JavaScript framework using ReactJS as we described in this long post we did not want to leave behind the quality of the UI/UX aspects as such we have set ambitious goals for that part as well; we want MapStore 2 to work nice on the mobile from the first version (i.e. responsive and mobile first or better work nice on all screen sizes) hence we want it to move away from complex desktop like UI as we used to do for MapStore 1 (bye bye Ext-JS) and create something that would be less intimidating at the first glance while retaining the ability to have sophisticated functionalities still available (yes, I am talkin to you QueryBuilder! See below..).

[caption id="attachment_2811" align="alignnone" width="800"]MapStore 2 Query Builder MapStore 2 Query Builder[/caption]

Well, while the first post on MapStore 2 was rather long this one is going to be rather small. If you are willing to have a look at what we are doing and give us your opinion you can find the current mock-up that is driving the GUI at this lin. You can also look at a static HTML+CSS mockup of the various components here which gets updated every time our colleagues at Chef Studio push new samples to GitHub. We are right now working on mounting the L&F on a the Q&A version of MapStore 2 so, stay tuned for an update on that.

Aside, in case you forgot the Q&A instance of MapStore 2 is available here and the stable version is available here. There is a continuous deploy mechanism in place so they both get update quite often, Q&A is update as the developer push something to GitHub while stable is update once the testers press the deploy button :).

If you are curious but you don't want to spend time on checking the links above, here below you have some screenshots (aren't they worth a thousand words?).

[caption id="attachment_2820" align="alignnone" width="800"]MapStore MapView on desktop MapStore MapView on desktop[/caption] [caption id="attachment_2821" align="alignnone" width="800"]MapStore MapView on mobile MapStore MapView on mobile[/caption] [caption id="attachment_2822" align="alignnone" width="800"]MapStore 2 HomePage MapStore 2 HomePage[/caption]

If you want to know more about how we can help your organization, don't hesitate and get in touch with us! Make sure to check our Enterprise Services Offer which is the contracting whicle we use to help our clients reach their goal with our products.

The GeoSolutions Team,

Geosolutions
Categories: OSGeo Planet

Fernando Quadro: Introdução ao OpenLayers 3: Raster

OSGeo Planet - Mon, 2016-05-23 10:10

Nas seções anteriores, nós exibimos camadas com base no padrão WMS. Quando falamos em mapeamento on-line, é importante ressaltar que ele foi amplamente popularizado pela disponibilidade de serviços de mapas proprietários. O OpenLayers fornece tipos de camadas que trabalham com esses serviços proprietários através da sua API.

Nesta seção, vamos construir a partir do exemplo desenvolvido na seção anterior uma camada usando o Bing. Para ver como utilizar o Google Maps com o OpenLayers 3, basta clicar nesse link.

1. Bing

Vamos adicionar uma camada Bing. Para isso em seu arquivo map.html, encontre onde está a chamada para a camada do OSM e substitua a referência pela classe ol.source.BingMaps conforme demonstrado abaixo:

source: new ol.source.BingMaps({
  imagerySet: 'Road',
  key: 'Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3'
})

Salve as alterações e recarregue o arquivo map.html no seu browser: @servidor@/map.html

A API do Bing requer que você registre uma chave para usar com seu aplicativo. O exemplo aqui usa uma chave que você não deve usar na produção. Para usar a camada do Bing na produção, registre sua chave em https://www.bingmapsportal.com/.

proprietary1

Após alterar seu arquivo map.html ele deve ser algo parecido com isto:

<!doctype html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="ol3/ol.css" type="text/css">
    <style>
      #map {
        height: 256px;
        width: 512px;
      }
      .ol-attribution a {
        color: black;
      }
    </style>
    <script src="ol3/ol.js" type="text/javascript"></script>
    <title>OpenLayers 3 example</title>
  </head>
  <body>
    <h1>My Map</h1>
    <div id="map" class="map"></div>
    <script type="text/javascript">
      var map = new ol.Map({
        target: 'map',
        layers: [
          new ol.layer.Tile({
            source: new ol.source.BingMaps({
              imagerySet: 'Road',
              key: 'Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3'
            })
          })
        ],
        view: new ol.View({
          center: ol.proj.transform([-93.27, 44.98], 'EPSG:4326', 'EPSG:3857'),
          zoom: 9
        })
      });
    </script>
  </body>
</html>

No próximo post você verá como criar camadas a partir de vetores e qual a sua utilidade prática.

Posts RelacionadosZemanta
Categories: OSGeo Planet

BostonGIS: pgRouting 2.2.3 released with support for PostgreSQL 9.6beta1

OSGeo Planet - Sat, 2016-05-21 16:24

pgRouting 2.2.3 was released last week. Main change is this version now supports PostgreSQL 9.6. Many thanks to Vicky Vergara for working thru the issues with PostgreSQL 9.6 and getting it to work. Vicky has also been doing a good chunk of the coding (a lot of Boost refactoring and integrating more Boost features), testing, and documentation in pgRouting, osm2pgrouting, and QGIS pgRoutingLayer in general for pgRouting 2.1, 2.2, and upcoming 2.3. We are very indebted to her for her hard work.

If you are a windows user testing the waters of PostgreSQL 9.6beta1, we have pgRouting 2.2.3 binaries and PostGIS 2.3.0dev binaries at http://postgis.net/windows_downloads.


Continue reading "pgRouting 2.2.3 released with support for PostgreSQL 9.6beta1"
Categories: OSGeo Planet

gvSIG Team: GIS of Thrones: Mapeando Juego de Tronos con gvSIG

OSGeo Planet - Fri, 2016-05-20 11:34

En muchas ocasiones, cuando realizamos tareas de formación, nos preguntan por juegos de datos libres para poder practicar e ir aprendiendo todas las posibilidades que nos da gvSIG. Afortunadamente hoy hay una cantidad inmensa de datos libres, pero también es cierto que pocas veces se encuentra información geográfica que nos permita divertirnos un poco mientras aprendemos a crear leyendas, etiquetados, realizar geoprocesos…

Andaba pensando en esto cuando encontré un juego de datos, con licencia libre, basado en la exitosa serie (de libros y de TV) Juego de Tronos. Tras revisarlo con gvSIG encontré unos cuantos errores en las capas de información, pero que mediante unos pocos geoprocesos se solucionaban con facilidad. Ya que estaba, ¿por qué no jugar un poco con la simbología y el etiquetado por escalas?

Os dejo un pequeño vídeo del resultado:

Y aquí tenéis un zip con los datos y el proyecto de gvSIG listo para ser utilizado. Ya sé con que proyecto voy a comenzar a testear la próxima versión de gvSIG…

downloads.gvsig.org/download/documents/books/GISofThrones.zip

Y otro día hablaremos de Star Wars…


Filed under: gvSIG Desktop, spanish, training
Categories: OSGeo Planet

Fernando Quadro: Introdução ao OpenLayers 3: Cache

OSGeo Planet - Fri, 2016-05-20 10:30

Por padrão, uma camada faz requisições para imagens com tamanho de 256 x 256 (pixel). A medida que você realiza as operações de pan e zoom no seu mapa, mais requisições de imagens são executadas para preencher as áreas que você ainda não visitou. Enquanto o seu navegador irá armazenar em cache algumas imagens solicitadas, bastante trabalho de processamento é normalmente necessária para o servidor renderizar imagens dinamicamente.

Para essas requisições é possível que o servidor armazene em cache essa requisições de imagens e retorne o resultado em cache a próxima vez que você (ou outra pessoa) visita na mesma área – o que resulta em um melhor desempenho do seu mapa.

1. ol.source.XYZ

A especificação Web Map Service (WMS) permite uma grande flexibilidade em termos do que um cliente pode solicitar. Sem restrições, o que torna o armazenamento em cache difícil ou impossível na prática.

No extremo oposto, um serviço pode oferecer tiles um conjunto fixo de níveis de zoom e apenas por um determinado extent (Bounding Box). Estes podem ser generalizados como camadas com uma fonte XYZ – você pode considerar X e Y para indicar a coluna e linha e Z para representar o nível de zoom.

2. ol.source.OSM

O OpenStreetMap (OSM) é um esforço para mapear e divulgar dados de mapas disponíveis gratuitamente para o mundo. O OSM fornece algumas representações diferentes de seus dados como conjuntos de tiles em cache. Estas representações estão em conformidade com a base o modelo XYZ e podem ser utilizadas em um mapa com Openlayers. O ol.source.OSM fornece acesso a essa camada.

Agora abra o arquivo map.html, utilizado no post anterior em um editor de texto e altere o código de inicialização do mapa para se parecer com o seguinte:

<script>
  var map = new ol.Map({
    target: 'map',
    layers: [
      new ol.layer.Tile({
        source: new ol.source.OSM()
      })
    ],
    view: new ol.View({
      center: ol.proj.transform([-93.27, 44.98], 'EPSG:4326', 'EPSG:3857'),
      zoom: 9
    }),
    controls: ol.control.defaults({
      attributionOptions: {
        collapsible: false
      }
    })
  });
</script>

No elemento head do mesmo documento, adicione algumas declarações de estilo para camada.

<style>
    #map {
        width: 512px;
        height: 256px;
    }
    .ol-attribution a {
        color: black;
    }
</style>

Salve as alterações e atualize a página no seu navegador: @servidor@/map.html

cached1

No próximo post estaremos falando sobre o uso de camadas raster no OpenLayers 3. Não perca!

Posts RelacionadosZemanta
Categories: OSGeo Planet

Gis-Lab: Плагин Attribute based clustering – простая кластеризация векторных объектов по атрибутам в QGIS

OSGeo Planet - Thu, 2016-05-19 15:12

В географических исследованиях часто возникает задача типологии изучаемых объектов по набору формализованных параметров. Как сгруппировать большое количество объектов в небольшое число классов по совокупности показателей, определенных для каждого их этих объектов? Существуют различные подходы, в том числе и математический.

В статье Эдуарда Казакова приводится краткое описание простого метода взвешенной иерархической кластеризации, а также упоминается классический K-Means; описывается разработанный плагин Attribute based clustering, реализующий их; приводится несколько примеров использования.

null

Прочитать | Обсудить

Categories: OSGeo Planet

Le blog de Geomatys: Geomatys recrute un(e) Front-end développeur(se)

OSGeo Planet - Thu, 2016-05-19 13:43
Nous sommes à la recherche d’un(e) développeur(euse) passionné(e) par le design Web, HTML5/CSS3 et le Javascript avec une forte sensibilité pour les différents frameworks émergents que sont Angular2, Babel et Cesium. Vous intégrerez une équipe dédiée au développement d’applications à fortes dominantes géographiques, constituée d’un UX/UI designer en charge de la réalisation des maquettes, et […]
Categories: OSGeo Planet

Le blog de Geomatys: Geomatys recrute Back-end développeur(se) avec 1ère expérience

OSGeo Planet - Thu, 2016-05-19 13:38
Nous sommes à la recherche d’un(e) développeur(euse) passionné(e) par la conception et le développement d’applications backend Java avec une bonne connaissance de Spring frameworks. Vous intégrerez une équipe dédiée au développement d’applications à fortes dominantes géographiques. Votre rôle sera de participer à l’Architecture de solutions robustes, évolutives et capables d’intégrer de gros volumes de données. […]
Categories: OSGeo Planet

Fernando Quadro: Introdução ao OpenLayers 3: Layers

OSGeo Planet - Thu, 2016-05-19 10:30

No último post você teve uma visão inicial sobre o OpenLayers 3, neste post iremos iniciar o assunto camadas (Layers).

Quando você adiciona uma camada ao seu mapa, os dados solicitados podem ser matriciais (raster) ou vetoriais. Você pode pensar em dados raster como informações prestadas através de imagens de satélite, e vetorial como informações estruturadas que podem ser processadas para exibição no navegador.

Há muitos tipos de serviços que fornecem dados raster. Esta seção vai lidar apenas com os que estão em conformidade com a especificação OGC Web Map Service (WMS).

Vamos começar com um exemplo de mapa completamento e vamos modificar as camadas para que você possa obter uma compreensão de como elas funcionam.

Dê uma olhada no seguinte código que já utilizamos no último post:

<!doctype html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="ol3/ol.css" type="text/css">
    <style>
      #map {
        height: 256px;
        width: 512px;
      }
    </style>
    <script src="ol3/ol.js" type="text/javascript"></script>
    <title>OpenLayers 3 example</title>
  </head>
  <body>
    <h1>My Map</h1>
    <div id="map"></div>
    <script type="text/javascript">
      var map = new ol.Map({
        target: 'map',
        layers: [
          new ol.layer.Tile({
            title: "Global Imagery",
            source: new ol.source.TileWMS({
              url: 'http://maps.opengeo.org/geowebcache/service/wms',
              params: {LAYERS: 'bluemarble', VERSION: '1.1.1'}
            })
          })
        ],
        view: new ol.View({
          projection: 'EPSG:4326',
          center: [0, 0],
          zoom: 0,
          maxResolution: 0.703125
        })
      });
    </script>
  </body>
</html>

Agora vamos detalhar os métodos utilizados na criação da camada do código acima:

1. A classe ol.layer.Tile

Através do construtor da classe ol.layer.Tile obtemos um objeto do tipo olx.layer.TileOptions. Neste caso estamos fornecendo as informações através da classe ol.source.TileWMS. Um título legível para a camada pode ser fornecida com através do parâmetro “title”, mas basicamente qualquer descrição pode ser utilizada como título. No OpenLayers 3 há uma separação entre as camadas e fontes (sources), enquanto que no OpenLayers 2 tudo fazia parte da camada.

A classe ol.layer.Tile representa uma grade de imagens, e a ol.layer.Image representa uma única imagem. Dependendo do tipo de camada, você deve usar uma fonte (source) diferente (ol.source.TileWMS ou ol.source.ImageWMS).

2. A classe ol.source.TileWMS

No construtor da classe ol.source.TileWMS estamos passando dois argumentos, um é o url do serviço WMS, e o outro é o params um objeto que possui os nomes de parâmetros e seus valores.

wms1

A versão 1.3.0 do WMS é a utilizada como padrão no OpenLayers, caso seja necessário fornecer uma versão anterior, é possível indicá-la no argumento params.

layers: [
  new ol.layer.Tile({
    title: "Global Imagery",
    source: new ol.source.TileWMS({
      url: 'http://maps.opengeo.org/geowebcache/service/wms',
      params: {LAYERS: 'bluemarble', VERSION: '1.1.1'}
    })
  })
]

Este mesmo serviço WMS oferece uma camada denominada “OpenStreetMap”. Altere o valor do parâmetro LAYERS de “bluemarble” para “OpenStreetMap”. Seu código da classe ol.layer.Tile deve ficar parecido com o código abaixo:

new ol.layer.Tile({
  title: "Global Imagery",
  source: new ol.source.TileWMS({
    url: 'http://maps.opengeo.org/geowebcache/service/wms',
    params: {LAYERS: 'openstreetmap', VERSION: '1.1.1'}
  })
})

No próximo post trataremos sobre camadas utilizando a prerrogativa do cache, para uma melhor performance do seu mapa.

Posts RelacionadosZemanta
Categories: OSGeo Planet
Syndicate content