Skip to content
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

Open
WeatherRouteing opened this issue Jan 20, 2025 · 5 comments
Open

postgresql not work #123

WeatherRouteing opened this issue Jan 20, 2025 · 5 comments
Assignees

Comments

@WeatherRouteing
Copy link

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...

@WeatherRouteing
Copy link
Author

@Jinnkunn please help me

@Jinnkunn Jinnkunn self-assigned this Jan 21, 2025
@Jinnkunn
Copy link
Collaborator

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!

@WeatherRouteing
Copy link
Author

@Jinnkunn Thanks,I have already sent the email to your email, please check it.

@gabrielspadon
Copy link
Collaborator

@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.

@tsuzzy
Copy link
Collaborator

tsuzzy commented Jan 24, 2025

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:

pip install git+https://github.com/AISViz/AISdb.git@master

Please note that this approach may require additional local build steps. We are working on preparing a new release and will keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants