[Geoserver-users] GeoServer setup with Leaflet.js

Dear All,

I’m pretty new to the world of GeoServer and of course, I’m in trouble!

My final aim is to develop a WebGIS where an user could click on a map and, from the coordinates of the clicked point, retrieve the number of closes point in circle range (spatial analysis) and show the numbers on a popup. After different hours of research and basic knowledge, I decided to use GeoServer + Leaflet.js (I preferred it to Openlayer and I think fit with my final aim)

I thouht that after a week of javascript and some tutorial online I could achieve this but unfortunatly not :(. I have mainly two questions but before I think I have to describe my environment.

I work on a windows 8 environment 64bit. I have installed TomCat and in the folder webapps I have put the geoserver.war. It was converted in a folder automatically and I could reach it on the following local host adress:

http://localhost:8082/geoserver/web/ (I have choose 8082 instead of 8080 during the installation of TomCat)

After that I simply download the client of Leaflet.js and put in the webapps folder of TomCat at the same level of GeoServer with the name ‘Leaflet’. I don’t know if I have to put it within the GeoServer folder or not. Afterthat, I create a basic html in the Leaflet folder. I followed the tutorial on the leaflet.js folder and everything works fine.

Now, the point is that I wanna load on a map, a shapefile of points. I know that I could write every point in an html file but I prefer to have a shapefile (create in a QGIS and convert with OGR (GDAL)). It’s simpler with hundreds/thousands of points. Actually here comes the doubts.

The main doubts are:

  • I know that I could upload the shapefiles in GeoServer following the tutorial and see them in an OpenLayer demo. The point is that I didn’t installed any PostGIS/PostgreSQL software. Do I need that right? How could I install in a way that it could communicates with GeoServer? I didn’t any tutorial because I have GeoServer within TomCat and so, in a different situation where I could install using GeoServer.exe. After that, I could recall that from my client using what url? localhost:8082/geoserver/web/…?

I understand that probably these are dummy doubts…but I wasn’t able to find any answer around on google. Do know any nice tutorial to follow that could clarify my questions? Any language is ok!

Thanks in advance for your support!
Gianni

Hi Gianni,
please, see my answers below.

···

2013/10/18 Gianni Iannelli <giannicristian@anonymised.com>

The main doubts are:

  • I know that I could upload the shapefiles in GeoServer following the tutorial and see them in an OpenLayer demo. The point is that I didn’t installed any PostGIS/PostgreSQL software. Do I need that right?

It’s not necessary to use PostGIS/PostgreSQL immediately, you can also directly publish your shapefiles inside GeoServer, without importing them into a database.
For your first experiments this should be enough.
You just have to configure a Store (a Shapefile store if you have just one, or a “Directory of spatial files” one if you have more) and publish one or more layers from it.
You can find information on the GeoServer user manual on how to do that, in particular here: http://docs.geoserver.org/stable/en/user/data/vector/index.html
When you will be confident with GeoServer you could try to import those shapefiles into a PostGIS database to get better performance.

  • How could I install in a way that it could communicates with GeoServer? I didn’t any tutorial because I have GeoServer within TomCat and so, in a different situation where I could install using GeoServer.exe. After that, I could recall that from my client using what url? localhost:8082/geoserver/web/…?

This is more a Leaflet related question, so I suggest you to ask to leaflet mailing lists (if there are any, I don’t know exactly, but I presume they exist) or search some tutorial/docs on how to use wms and wfs services with leaflet. Basically in your case Geoserver publishes wms services on the http://localhost:8082/geoserver/wms and wfs services on the http://localhost:8082/geoserver/wfs url. The http://localhost:8082/geoserver/web url is just the admin UI endpoint.

Regard,
Mauro Bartolomeoli

2013/10/18 Gianni Iannelli <giannicristian@anonymised.com>:

Dear All,

I'm pretty new to the world of GeoServer and of course, I'm in trouble!

My final aim is to develop a WebGIS where an user could click on a map and,
from the coordinates of the clicked point, retrieve the number of closes
point in circle range (spatial analysis) and show the numbers on a popup.
After different hours of research and basic knowledge, I decided to use
GeoServer + Leaflet.js (I preferred it to Openlayer and I think fit with my
final aim)

I thouht that after a week of javascript and some tutorial online I could
achieve this but unfortunatly not :(. I have mainly two questions but before
I think I have to describe my environment.

I work on a windows 8 environment 64bit. I have installed TomCat and in the
folder webapps I have put the geoserver.war. It was converted in a folder
automatically and I could reach it on the following local host adress:

http://localhost:8082/geoserver/web/ (I have choose 8082 instead of 8080
during the installation of TomCat)

After that I simply download the client of Leaflet.js and put in the webapps
folder of TomCat at the same level of GeoServer with the name 'Leaflet'. I
don't know if I have to put it within the GeoServer folder or not.
Afterthat, I create a basic html in the Leaflet folder. I followed the
tutorial on the leaflet.js folder and everything works fine.

Now, the point is that I wanna load on a map, a shapefile of points. I know
that I could write every point in an html file but I prefer to have a
shapefile (create in a QGIS and convert with OGR (GDAL)). It's simpler with
hundreds/thousands of points. Actually here comes the doubts.

The main doubts are:

I know that I could upload the shapefiles in GeoServer following the
tutorial and see them in an OpenLayer demo. The point is that I didn't
installed any PostGIS/PostgreSQL software. Do I need that right? How could I
install in a way that it could communicates with GeoServer? I didn't any
tutorial because I have GeoServer within TomCat and so, in a different
situation where I could install using GeoServer.exe. After that, I could
recall that from my client using what url? localhost:8082/geoserver/web/...?

You don't need a database if you don't want to. You can publish your
shapefile directly with geoserver. Check the documentation[1]. Anyway
I recommend to do the Boundless GeoServer workshop to get a better
idea of what GeoServer is, and specially their main components and
concepts (Workspace/Store/Layer/Style/etc). After that you'll know how
to publish your data to any WMS/WFS client.

I understand that probably these are dummy doubts...but I wasn't able to
find any answer around on google. Do know any nice tutorial to follow that
could clarify my questions? Any language is ok!

There are never dummy doubts, if you do your research and don't find a
good answer on the list archives or any other resource, asking here is
perfectly OK.

BR

[1] Shapefile — GeoServer 2.26.x User Manual
[2] http://workshops.boundlessgeo.com/geoserver-intro/

--
Jorge Sanz

http://wiki.osgeo.org/wiki/Jorge_Sanz

Thanks to your answer! I will take a look on everything! My weekend will be very full! :smiley:

Thanks!
Gianni

From: jsanz@anonymised.com
Date: Fri, 18 Oct 2013 11:58:18 +0200
Subject: Re: [Geoserver-users] GeoServer setup with Leaflet.js
To: giannicristian@anonymised.com
CC: geoserver-users@lists.sourceforge.net

Dear All,

I’m pretty new to the world of GeoServer and of course, I’m in trouble!

My final aim is to develop a WebGIS where an user could click on a map and,
from the coordinates of the clicked point, retrieve the number of closes
point in circle range (spatial analysis) and show the numbers on a popup.
After different hours of research and basic knowledge, I decided to use
GeoServer + Leaflet.js (I preferred it to Openlayer and I think fit with my
final aim)

I thouht that after a week of javascript and some tutorial online I could
achieve this but unfortunatly not :(. I have mainly two questions but before
I think I have to describe my environment.

I work on a windows 8 environment 64bit. I have installed TomCat and in the
folder webapps I have put the geoserver.war. It was converted in a folder
automatically and I could reach it on the following local host adress:

http://localhost:8082/geoserver/web/ (I have choose 8082 instead of 8080
during the installation of TomCat)

After that I simply download the client of Leaflet.js and put in the webapps
folder of TomCat at the same level of GeoServer with the name ‘Leaflet’. I
don’t know if I have to put it within the GeoServer folder or not.
Afterthat, I create a basic html in the Leaflet folder. I followed the
tutorial on the leaflet.js folder and everything works fine.

Now, the point is that I wanna load on a map, a shapefile of points. I know
that I could write every point in an html file but I prefer to have a
shapefile (create in a QGIS and convert with OGR (GDAL)). It’s simpler with
hundreds/thousands of points. Actually here comes the doubts.

The main doubts are:

I know that I could upload the shapefiles in GeoServer following the
tutorial and see them in an OpenLayer demo. The point is that I didn’t
installed any PostGIS/PostgreSQL software. Do I need that right? How could I
install in a way that it could communicates with GeoServer? I didn’t any
tutorial because I have GeoServer within TomCat and so, in a different
situation where I could install using GeoServer.exe. After that, I could
recall that from my client using what url? localhost:8082/geoserver/web/…?

You don’t need a database if you don’t want to. You can publish your
shapefile directly with geoserver. Check the documentation[1]. Anyway
I recommend to do the Boundless GeoServer workshop to get a better
idea of what GeoServer is, and specially their main components and
concepts (Workspace/Store/Layer/Style/etc). After that you’ll know how
to publish your data to any WMS/WFS client.

I understand that probably these are dummy doubts…but I wasn’t able to
find any answer around on google. Do know any nice tutorial to follow that
could clarify my questions? Any language is ok!

There are never dummy doubts, if you do your research and don’t find a
good answer on the list archives or any other resource, asking here is
perfectly OK.

BR

[1] http://docs.geoserver.org/stable/en/user/data/vector/shapefile.html
[2] http://workshops.boundlessgeo.com/geoserver-intro/


Jorge Sanz
http://www.osgeo.org
http://wiki.osgeo.org/wiki/Jorge_Sanz

I am quite new to Geoserver too, but I have made some simple javascript based apps.

I have created a web page in Georserver's www folder. Then I created a folder "externals" in www-folder, where I have put all my .js files.

All my web pages code (html) then point to that folder like this:

<script type="text/javascript" src="externals/myjavascript.js"></script>

Oiva

________________________________________
Lähettäjä: Jorge Sanz [jsanz@anonymised.com]
Lähetetty: 18. lokakuuta 2013 12:58
Vastaanottaja: Gianni Iannelli
Kopio: geoserver-users@lists.sourceforge.net
Aihe: Re: [Geoserver-users] GeoServer setup with Leaflet.js

2013/10/18 Gianni Iannelli <giannicristian@anonymised.com>:

Dear All,

I'm pretty new to the world of GeoServer and of course, I'm in trouble!

My final aim is to develop a WebGIS where an user could click on a map and,
from the coordinates of the clicked point, retrieve the number of closes
point in circle range (spatial analysis) and show the numbers on a popup.
After different hours of research and basic knowledge, I decided to use
GeoServer + Leaflet.js (I preferred it to Openlayer and I think fit with my
final aim)

I thouht that after a week of javascript and some tutorial online I could
achieve this but unfortunatly not :(. I have mainly two questions but before
I think I have to describe my environment.

I work on a windows 8 environment 64bit. I have installed TomCat and in the
folder webapps I have put the geoserver.war. It was converted in a folder
automatically and I could reach it on the following local host adress:

http://localhost:8082/geoserver/web/ (I have choose 8082 instead of 8080
during the installation of TomCat)

After that I simply download the client of Leaflet.js and put in the webapps
folder of TomCat at the same level of GeoServer with the name 'Leaflet'. I
don't know if I have to put it within the GeoServer folder or not.
Afterthat, I create a basic html in the Leaflet folder. I followed the
tutorial on the leaflet.js folder and everything works fine.

Now, the point is that I wanna load on a map, a shapefile of points. I know
that I could write every point in an html file but I prefer to have a
shapefile (create in a QGIS and convert with OGR (GDAL)). It's simpler with
hundreds/thousands of points. Actually here comes the doubts.

The main doubts are:

I know that I could upload the shapefiles in GeoServer following the
tutorial and see them in an OpenLayer demo. The point is that I didn't
installed any PostGIS/PostgreSQL software. Do I need that right? How could I
install in a way that it could communicates with GeoServer? I didn't any
tutorial because I have GeoServer within TomCat and so, in a different
situation where I could install using GeoServer.exe. After that, I could
recall that from my client using what url? localhost:8082/geoserver/web/...?

You don't need a database if you don't want to. You can publish your
shapefile directly with geoserver. Check the documentation[1]. Anyway
I recommend to do the Boundless GeoServer workshop to get a better
idea of what GeoServer is, and specially their main components and
concepts (Workspace/Store/Layer/Style/etc). After that you'll know how
to publish your data to any WMS/WFS client.

I understand that probably these are dummy doubts...but I wasn't able to
find any answer around on google. Do know any nice tutorial to follow that
could clarify my questions? Any language is ok!

There are never dummy doubts, if you do your research and don't find a
good answer on the list archives or any other resource, asking here is
perfectly OK.

BR

[1] http://docs.geoserver.org/stable/en/user/data/vector/shapefile.html
[2] http://workshops.boundlessgeo.com/geoserver-intro/

--
Jorge Sanz
http://www.osgeo.org
http://wiki.osgeo.org/wiki/Jorge_Sanz

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users