Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to upload a 20MB shapefile using the REST API, but gets a timeout error. I can upload smaller files without problems.

I'd like to be able to upload a shapefile of any size without restriction. If there's a way of specifying timeout, I guess it might be problematic as I wouldn't want to restrict file size; I do validation on the shapefile, and it should be uploaded provided it's valid.

Part of my code is shown below:

    private string getDbXml(string dsName)
    {
        string exposePKsParameter = "<entry key=\"Expose primary keys\">true</entry>";

        string xml = "<dataStore>" +
                        "<name>" + dsName + "</name>" + 
                        "<enabled>true</enabled>" + 
                        "<connectionParameters>" + 
                            "<host>" + DB_HOST + "</host>" + 
                            "<port>" + DB_PORT + "</port>" + 
                            "<database>" + DB_NAME + "</database>" + 
                            "<user>" + DB_USER + "</user>" + 
                            "<password>" + DB_PASSWD + "</password>" +
                            "<dbtype>" + DB_TYPE + "</dbtype>" + 
                            "<namespace>" + dsName + "_NS</namespace>" + 
                            exposePKsParameter + 
                         "</connectionParameters>" + 
                      "</dataStore>";

        return xml;

    }

My environment setup: GeoServer 2.1.3, PostGIS 1.5, and C#.

share|improve this question
    
What is it that's timing out? The client side or the server side? Did you check the error messages/logs on both sides? –  Andrea Aime Jun 25 '12 at 12:10
    
Btw, you can also try the FTP module to upload the data, and then configure it with REST from a file that's local to the server (that is, separate the upload and configure parts). This is going to work with whatever file size, FTP is designed for the job and also has upload resume abilities –  Andrea Aime Jun 25 '12 at 12:12
    
@Andrea After investigation, I've found out that it was the network connection that was timing out. Its something specific to my language of implementation; c#. Thanks for the FTP suggestion. I'm going to find more about it. –  okello Jun 25 '12 at 12:25
    
load your shapefile into postgres - and this will speed up the process and eliminate the time out. 20mb for a web browser to display is quite large and will time out - connected to a db is less likely. –  Mapperz Jun 25 '12 at 13:27
    
@Mapperz I'm leveraging the REST API in automating the process of creating data source and featureType from PostGIS tables. I'm doing everything from the client side (web browser), and I'm thinking that it may be too complex to upload the shapefile to the DB first, and then do all the rest using the API. So, I thought that letting GeoServer handle everything may be the better option. –  okello Jun 25 '12 at 14:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.