[Geoserver-users] searching GeoServer layers on leaflet.js

Hello

I would like to configure leaflet-search http://labs.easyblog.it/maps/leaflet-search/ to search against parcels that are stored in GeoServer. In their examples their geoJSON is expecting the latitude and longitude to be in separate columns, while GeoServers default geoJSON format has the coordinates in an array. A member of the leaflet mail list mentioned that I should add a column in my shapefile for lat and long so I can use leaflet search. I don’t know if this would be the best solution as it would imply that I would need to change the data for all of my layers in GeoServer. Instead I would like to check with this group to see if anyone has had success in either 1) creating a geoJSON template that populates the required latitude and longitude values from the shape itself, or 2) Reconfigured the code in leaflet to work with geoServers native geoJSON output.

Please let me know if anyone has had success in configuring GeoServer and leaflet-search.

Thank You

Sincerely,

Mark Volz, GISP

While it is possible to make a custom format (generating your own JSON output) it seems a bit of a bother. I guess if you have to do this for the Leaflet code to work you may consider using an a GeoServer SQL view (using SQL to extract an appropriate X and Y column from the geometry).

···

On 8 December 2014 at 11:43, Mark Volz <MarkVolz@anonymised.com> wrote:

Hello

I would like to configure leaflet-search http://labs.easyblog.it/maps/leaflet-search/ to search against parcels that are stored in GeoServer. In their examples their geoJSON is expecting the latitude and longitude to be in separate columns, while GeoServers default geoJSON format has the coordinates in an array. A member of the leaflet mail list mentioned that I should add a column in my shapefile for lat and long so I can use leaflet search. I don’t know if this would be the best solution as it would imply that I would need to change the data for all of my layers in GeoServer. Instead I would like to check with this group to see if anyone has had success in either 1) creating a geoJSON template that populates the required latitude and longitude values from the shape itself, or 2) Reconfigured the code in leaflet to work with geoServers native geoJSON output.

Please let me know if anyone has had success in configuring GeoServer and leaflet-search.

Thank You

Sincerely,

Mark Volz, GISP


Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Jody Garnett

On Mon, Dec 8, 2014 at 8:43 PM, Mark Volz <MarkVolz@anonymised.com> wrote:

Hello

I would like to configure leaflet-search
http://labs.easyblog.it/maps/leaflet-search/ to search against parcels
that are stored in GeoServer. In their examples their geoJSON is expecting
the latitude and longitude to be in separate columns, while GeoServers
default geoJSON format has the coordinates in an array. A member of the
leaflet mail list mentioned that I should add a column in my shapefile for
lat and long so I can use leaflet search. I don’t know if this would be
the best solution as it would imply that I would need to change the data
for all of my layers in GeoServer. Instead I would like to check with this
group to see if anyone has had success in either 1) creating a geoJSON
template that populates the required latitude and longitude values from the
shape itself,

You might have some luck using the XSLT output format generator:
http://docs.geoserver.org/stable/en/user/extensions/xslt/index.html

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Please, notice that GeoSolutions will be closed for seasonal holidays
from December the 24th to January the 6th

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------