help in inserting data

15 views
Skip to first unread message

maurice Libes

unread,
Jan 19, 2023, 10:32:52 AM1/19/23
to istSOS
hello

I am inserting some data from CSV files with the csv2istsos.py script and
the file is formated on the same manner from beginning to end, and some data get into the istSOS BD and some other no

I dont understand the errors I got below
Insert observations failed - Communication: 200 local variable 'e' referenced before assignment 
and
 'ValueError: could not convert string to float: 

maybe some data are wrong into the file, but I have none ideas where they could be?

how can I debug the problem? 
many thanks
Maurice

</ExceptionReport>
Insert ST: Omega
 > Begin: 2012-10-25T09:11:25+01:00
   + End: 2013-12-31T23:39:03.300000+00:00
 > Values: 9860
 > Insert observation success of 5000/9860 (2012-10-25T09:11:25.000000+0100 / 2013-06-12T14:59:06.000000+0100) observations: False
Insert observations failed - Communication: 200 local variable 'e' referenced before assignment - Response: <?xml version="1.0" encoding="UTF-8" standalone="no"?><ExceptionReport xmlns="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 ../owsExceptionReport.xsd" version="1.0.0" xml:lang="en">
 <Exception exceptionCode="NoApplicableCode">


  <ExceptionText>
    ['Traceback (most recent call last):\n', '  File "/usr/share/istsos/application_istsoslib.py", line 94, in executeSos\n    response = FR.sosFactoryResponse(req_filter, pgdb)\n', '  File "/usr/share/istsos/istsoslib/responders/factory_response.py", line 50, in sosFactoryResponse\n    return IOresponse.InsertObservationResponse(sosFilter, pgdb)\n', '  File "/usr/share/istsos/istsoslib/responders/IOresponse.py", line 506, in __init__\n    val = float(filter.data[par]["vals"][ii])\n', 'ValueError: could not convert string to float: \n']
  </ExceptionText>
 </Exception>
</ExceptionReport>

 > Values: 16839
 > Insert observation success of 5000/16839 (2012-10-25T09:11:25.000000+0100 / 2013-06-12T14:59:06.000000+0100) observations: False
Insert observations failed - Communication: 200 local variable 'e' referenced before assignment - Response: <?xml version="1.0" encoding="UTF-8" standalone="no"?><ExceptionReport xmlns="http://www.opengis.net/ows/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 ../owsExceptionReport.xsd" version="1.0.0" xml:lang="en">
 <Exception exceptionCode="NoApplicableCode">
  <ExceptionText>
 


 > Insert observation success of 15000/16839 (2014-01-06T20:17:35.000000+0100 / 2014-09-03T21:19:15.000000+0100) observations: True
 > Insert observation success of 16839/16839 (2014-09-03T21:19:15.000000+0100 / 2014-11-19T10:14:03+00:00) observations: True
 
 
Omega_20121231231124.dat

maurice Libes

unread,
Jan 19, 2023, 10:46:22 AM1/19/23
to istSOS
juste after posting, I found the problem, 
I had some empty values in the csv file.

So I modify my question, to know
 if it would be possible that the csv2istsos.py script could display the line number of the file in which it encounter a problem?

maurice

Camille MONCHICOURT

unread,
Jan 19, 2023, 1:12:55 PM1/19/23
to ist...@googlegroups.com
Hi Maurice,

I think the istSOS-import application that Théo has developped is able to manage NULL values.
See the dedicated section in the documentation: https://github.com/PnEcrins/Istsos-import

All the best,


   
Camille MONCHICOURT
Responsable du pôle SI / Géomaticien

Parc national des Ecrins
Tél : +33 (0)4 92 40 20 30 / +33 (0)6 99 77 37 53
www.ecrins-parcnational.fr



De: "maurice Libes" <mauric...@gmail.com>
À: "istSOS" <ist...@googlegroups.com>
Envoyé: Jeudi 19 Janvier 2023 16:46:22
Objet: [istSOS] Re: help in inserting data

--
You received this message because you are subscribed to the Google Groups "istSOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to istsos+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/istsos/e1fe4328-c28a-49a9-96cc-ab0982298c32n%40googlegroups.com.

maurice Libes

unread,
Jan 20, 2023, 5:13:56 AM1/20/23
to istSOS
ok thanks I will test your version

maybe it could be useful to send your modification(s) to the development team of istsos
in order to produce a new version :-)

see you

Maurice

Reply all
Reply to author
Forward
0 new messages