-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgresql not work #123
Comments
@Jinnkunn please help me |
Hi @WeatherRouteing , thank you for bringing this issue to our attention! Would it be ok if we continued this conversation via email? It would help me gather more detailed information to better understand and address the problem. You can find my email address on my profile page. Looking forward to hearing from you! |
@Jinnkunn Thanks,I have already sent the email to your email, please check it. |
@WeatherRouteing, seems like you are using NOAA data. AISdb was developed first to work with AIS data from private companies (they have more variables than open-source AIS data). I believe the error you are seeing is because the names of the variables do not match what is expected from the decoding function of AISdb. @tsuzzy was working with this recently, she can say more about it. |
Hi @WeatherRouteing, the NOAA feature has not yet been included in the latest public release. You can access it by installing the master branch of AISdb with the following command:
Please note that this approach may require additional local build steps. We are working on preparing a new release and will keep you posted. |
import aisdb
Establish a connection to the SQLite database and decode messages from the CSV file
with aisdb.SQLiteDBConn('test_decode_msgs2.db') as dbconn:
aisdb.decode_msgs(filepaths=["AIS_2023_01_01.csv"],
dbconn=dbconn, source='Testing', verbose=True)
psql connection string
USER = 'postgres'
PASSWORD = 'asdasdaw'
ADDRESS = 'localhost'
PORT = 5432
DBNAME = 'noaa'
psql_conn_string = f"postgresql://{USER}:{PASSWORD}@{ADDRESS}:{PORT}/{DBNAME}"
filepaths = ['AIS_2023_01_01.csv',]
使用 aisdb.PostgresDBConn 和 aisdb.decode_msgs
with aisdb.PostgresDBConn(libpq_connstring=psql_conn_string) as dbconn:
aisdb.decode_msgs(filepaths,
dbconn=dbconn,
source='NOAA',
verbose=False,skip_checksum=True)
I want to know why the same data can be stored in SQLite but cannot be stored in PostgreSQL. The error message is:
generating file checksums...
checking file dates...
creating tables and dropping table indexes...
saving checksums...
error processing AIS_2023_01_01.csv, skipping checksum...
cleaning temporary data...
rebuilding indexes...
indexing 202001...
aggregating static reports into static_202001_aggregate...
The text was updated successfully, but these errors were encountered: