So I've taken over a project from two other programmers as a part of my internship and I'm having a little trouble pinpointing why a part of it isn't working properly.
The website itself is a very simple bland site with an openlayers map and three buttons. One button is linked to geoserver, where I can fill in the name of the shapefile (*.shp) that I want to load and then it should load the shapefile data onto the openlayers map. The previous interns had this working on localhost and I've also set it up like that, but I still feel like it's a problem with my geoserver-setup rather than a problem with the file path.
My main question is whether it's possible to place a shapefile in the geoserver map > data_dir > data directory and if Geoserver is able to provide it just like that through the GetMap command of the Geoserver Get Map Service. Or whether I specifically have to add every shapefile manually, as described here: http://docs.geoserver.org/stable/en/user/gettingstarted/shapefile-quickstart/index.html
Adding the shapefile manually seems to require me to create a workspace, store & layer for each shapefile. Another problem I run into when I try this approach is that only the shapefile from the tutorial can be added without running into errors. And I can't load the shapefiles I provide by myself. The previous interns (who did not document how they did it) did manage to get it working, so I'm sure the shapefile itself isn't corrupt.
Steps in which I've added the shapefile to GeoServer:
I've probably added the new workspace correctly:
I've probably also added the new store correctly:
Adding a new Layer is where I believe I'm making a mistake:
I'm not 100% sure that the lon/lat generated from the Declared SRS are the right ones, but when I check it's coordinates it seems to check-out. I need the bounding box of the sea-area (Wadden Sea) in between Northwestern-Holland and the islands.
I also do not know if I picked the right style in the publish tab of the layer.
Anyway, when I preview the layer, I'm supposed to see something similar to the preview in the tutorial, yet what I see is this.
Please help, I have no clue what I'm doing wrong and usually I would second-guess the shapefile itself, but this is the only one I have of this bounding box area and it's the only area I am restricted to look at.
I've managed to get it to work and the reason this was so difficult was because there were two problems causing this.
The first problem was that I was somehow supplied with a faulty shapefile and as soon as I was given an updated version of it, I was instantly able to display it through the layer preview option in Geoserver.
The second problem was that the coordinates of the Lat/Lon Bounding Box that were automatically computed from native bounds were switched around. So X min and max needed to be moved to Y and Y needed to be moved to X. And this allowed me to display the shapefile in my openlayers web application.